Files
2026-08-31 15:06:55 +08:00

47 lines
981 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import App from './App'
import messages from './locale/index'
import uviewPlus from '@/uni_modules/uview-plus'
import { createSSRApp, h } from 'vue'
import { createI18n } from 'vue-i18n'
// #ifdef H5
import VueClipboard from 'vue-clipboard2'
// #endif
const i18nConfig = {
locale: uni.getLocale(),
messages
}
const i18n = createI18n(i18nConfig)
export function createApp() {
const app = createSSRApp(App)
// #ifdef H5
app.component('AsyncError', {
props: ['error'],
mounted() {
console.error('[AsyncPageError]', this.error)
},
render() {
const detail = import.meta.env.DEV && this.error
? `:${this.error.message || String(this.error)}`
: ''
return h('div', {
class: 'uni-async-error',
onClick: () => window.location.reload()
}, `页面加载失败${detail},点击屏幕重试`)
}
})
app.use(VueClipboard);
// #endif
app.use(i18n)
app.use(uviewPlus)
return {
app
}
}