123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import App from './App';
- import messages from './locale/index';
- // 全局mixins,用于实现setData等功能,请勿删除!';
- import zpMixins from '@/uni_modules/zp-mixins/index.js';
- const systemInfo = uni.getSystemInfoSync().appLanguage
- const localLang = systemInfo === 'zh-Hans' ? "zh" : "en"
- let i18nConfig = {
- locale: localLang,
- messages
- }
- // #ifndef VUE3
- import Vue from 'vue';
- Vue.use(zpMixins);
- // 导入p-f-unicom
- import unicom from '@/uni_modules/p-f-unicom/index.js';
- // 用于解决组件间关系(目前受制于平台及写法,仍可能存在小部分场景不生效,需手动调试修复或『替换对应组件』)
- Vue.use(unicom, {
- name: 'unicom',
- idName: 'unicomId',
- groupName: 'unicomGroup'
- });
- import VueI18n from 'vue-i18n'
- Vue.use(VueI18n)
- const i18n = new VueI18n(i18nConfig)
- Vue.config.productionTip = false;
- App.mpType = 'app';
- const app = new Vue({
- i18n,
- ...App
- });
- app.$mount();
- // #endif
- // #ifdef VUE3
- import { createSSRApp } from 'vue';
- import { createI18n } from 'vue-i18n'
- const i18n = createI18n(i18nConfig)
- export function createApp() {
- const app = createSSRApp(App);
- app.use(i18n)
- app.mixin(zpMixins);
- return {
- app
- };
- }
- // #endif
|