main.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import App from './App'
  2. import messages from './locale/index'
  3. let i18nConfig = {
  4. locale: uni.getLocale(),
  5. messages
  6. }
  7. // #ifndef VUE3
  8. import Vue from 'vue'
  9. import VueI18n from 'vue-i18n'
  10. Vue.use(VueI18n)
  11. const i18n = new VueI18n(i18nConfig)
  12. Vue.config.productionTip = false
  13. App.mpType = 'app'
  14. const app = new Vue({
  15. i18n,
  16. ...App
  17. })
  18. app.$mount()
  19. // #endif
  20. // #ifdef VUE3
  21. import {
  22. createSSRApp
  23. } from 'vue'
  24. import {
  25. createI18n
  26. } from 'vue-i18n'
  27. const i18n = createI18n(i18nConfig)
  28. export function createApp() {
  29. const app = createSSRApp(App)
  30. app.use(i18n)
  31. return {
  32. app
  33. }
  34. }
  35. // #endif
  36. import uView from '@/uni_modules/uview-ui'
  37. Vue.use(uView)
  38. import store from './store' // store
  39. Vue.prototype.$store = store
  40. import plugins from './plugins' // plugins
  41. Vue.use(plugins)
  42. import VueVirtualScroller from 'vue-virtual-scroller'
  43. Vue.use(VueVirtualScroller)
  44. // import moment from 'moment'
  45. // Vue.prototype.$moment = moment
  46. // import cuCustom from '@/colorui/components/cu-custom.vue'
  47. // Vue.component('cu-custom',cuCustom)