main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. import { confirm } from '@/component/comPopup/index.js'
  11. Vue.prototype.$confirm = confirm
  12. Vue.use(uView);
  13. let i18nConfig = {
  14. locale: "zh",
  15. //locale: uni.getLocale(),
  16. messages
  17. }
  18. // #ifndef VUE3
  19. import Vue from 'vue';
  20. Vue.mixin(Mixin);
  21. import VueI18n from 'vue-i18n'
  22. Vue.use(VueI18n)
  23. const i18n = new VueI18n(i18nConfig)
  24. Vue.config.productionTip = false;
  25. App.mpType = 'app';
  26. const app = new Vue({
  27. i18n,
  28. ...App
  29. });
  30. app.$mount();
  31. // #endif
  32. // #ifdef VUE3
  33. import { createSSRApp } from 'vue';
  34. import {
  35. createI18n
  36. } from 'vue-i18n'
  37. const i18n = createI18n(i18nConfig)
  38. export function createApp() {
  39. const app = createSSRApp(App);
  40. app.use(i18n)
  41. app.mixin(Mixin);
  42. return {
  43. app
  44. };
  45. }
  46. // #endif