main.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import Vue from 'vue'
  2. import App from './App'
  3. import VueI18n from 'vue-i18n';
  4. import Requires from '@/img.js';
  5. import sunui from './utils/sun.js';
  6. import MescrollEmpty from './components/mescroll-uni/components/mescroll-empty.vue';
  7. import MescrollBody from './components/mescroll-uni/mescroll-body.vue';
  8. import MescrollUni from '@/components/mescroll-uni/mescroll-uni.vue';
  9. import mixins from '@/components/mescroll-uni/mescroll-mixins.js';
  10. import messages from '@/locale/index.js';
  11. import SunuiNavbar from './components/sunui-navbar/sunui-navbar.vue';
  12. let i18nConfig = {
  13. locale: uni.getStorageSync('locale') || 'zh_CN',
  14. messages
  15. }
  16. Vue.use(VueI18n)
  17. const i18n = new VueI18n(i18nConfig)
  18. Vue.mixin(mixins);
  19. Vue.component('mescroll-empty', MescrollEmpty);
  20. Vue.component('mescroll-body', MescrollBody);
  21. Vue.component('mescroll-uni', MescrollUni);
  22. Vue.component('sunui-navbar', SunuiNavbar);
  23. import uView from '@/uni_modules/uview-ui';
  24. // 此为uView的按需引入方式,如果此行报错或提示找不到模块,则可能是uView版本不支持或者还未正确安装
  25. // 此数组中为需要引入的组件名称,如果不需要某个组件,则去掉相应名称即可
  26. Vue.use(uView)
  27. // 如此配置即可
  28. uni.$u.config.unit = 'rpx'
  29. Vue.config.productionTip = false
  30. Vue.prototype.$require = Requires;
  31. Vue.prototype.$sun = sunui;
  32. App.mpType = 'app'
  33. const app = new Vue({
  34. i18n,
  35. ...App
  36. })
  37. app.$mount()