import Vue from 'vue' import App from './App' import VueI18n from 'vue-i18n'; import Requires from '@/img.js'; import sunui from './utils/sun.js'; import MescrollEmpty from './components/mescroll-uni/components/mescroll-empty.vue'; import MescrollBody from './components/mescroll-uni/mescroll-body.vue'; import MescrollUni from '@/components/mescroll-uni/mescroll-uni.vue'; import mixins from '@/components/mescroll-uni/mescroll-mixins.js'; import messages from '@/locale/index.js'; import SunuiNavbar from './components/sunui-navbar/sunui-navbar.vue'; let i18nConfig = { locale: uni.getStorageSync('locale') || 'zh_CN', messages } Vue.use(VueI18n) const i18n = new VueI18n(i18nConfig) Vue.mixin(mixins); Vue.component('mescroll-empty', MescrollEmpty); Vue.component('mescroll-body', MescrollBody); Vue.component('mescroll-uni', MescrollUni); Vue.component('sunui-navbar', SunuiNavbar); import uView from '@/uni_modules/uview-ui'; // 此为uView的按需引入方式,如果此行报错或提示找不到模块,则可能是uView版本不支持或者还未正确安装 // 此数组中为需要引入的组件名称,如果不需要某个组件,则去掉相应名称即可 Vue.use(uView) // 如此配置即可 uni.$u.config.unit = 'rpx' Vue.config.productionTip = false Vue.prototype.$require = Requires; Vue.prototype.$sun = sunui; App.mpType = 'app' const app = new Vue({ i18n, ...App }) app.$mount()