| | |
| | | import uView from '@/uni_modules/uview-ui' |
| | | Vue.use(uView) |
| | | |
| | | Vue.mixin({ |
| | | methods: { |
| | | $showToast(options) { |
| | | if (this.$refs.uToast) { |
| | | this.$refs.uToast.show(options); |
| | | } else { |
| | | // Fallback if component not found or loaded yet |
| | | uni.$u.toast(typeof options === 'string' ? options : (options.message || options.title)); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | const i18n = new VueI18n(i18nConfig) |
| | | const app = new Vue({ |
| | | ...App, |
| | |
| | | export function createApp() { |
| | | const app = createSSRApp(App) |
| | | app.use(uView) |
| | | app.mixin({ |
| | | methods: { |
| | | $showToast(options) { |
| | | if (this.$refs.uToast) { |
| | | this.$refs.uToast.show(options); |
| | | } else { |
| | | uni.$u.toast(typeof options === 'string' ? options : (options.message || options.title)); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | return { |
| | | app |
| | | } |