main.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import App from './App';
  2. // Api函数polyfill(目前为实验版本,如不需要,可删除!)';
  3. import Polyfill from './polyfill/polyfill';
  4. // import customTabBar from './custom-tab-bar/index.vue';
  5. Polyfill.init();
  6. // 全局mixins,用于实现setData等功能,请勿删除!';
  7. import Mixin from './polyfill/mixins';
  8. import messages from './locale/index'
  9. import uView from "uview-ui";
  10. Vue.use(uView);
  11. let i18nConfig = {
  12. locale: "zh",
  13. //locale: uni.getLocale(),
  14. messages
  15. }
  16. // #ifndef VUE3
  17. import Vue from 'vue';
  18. Vue.mixin(Mixin);
  19. import VueI18n from 'vue-i18n'
  20. Vue.use(VueI18n)
  21. const i18n = new VueI18n(i18nConfig)
  22. Vue.config.productionTip = false;
  23. App.mpType = 'app';
  24. const app = new Vue({
  25. i18n,
  26. ...App
  27. });
  28. app.$mount();
  29. // #endif
  30. // #ifdef VUE3
  31. import { createSSRApp } from 'vue';
  32. import {
  33. createI18n
  34. } from 'vue-i18n'
  35. const i18n = createI18n(i18nConfig)
  36. export function createApp() {
  37. const app = createSSRApp(App);
  38. app.use(i18n)
  39. app.mixin(Mixin);
  40. return {
  41. app
  42. };
  43. }
  44. // #endif