main.js 909 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. import './uni.promisify.adaptor'
  5. import uView from '@/uni_modules/uview-ui'
  6. Vue.use(uView)
  7. import './utils/filter'
  8. import config from './common/config.js'
  9. Vue.prototype.$config = config
  10. // 引入vuex
  11. import store from './store'
  12. // Vue.prototype.$store = store
  13. uni.$u.setConfig({
  14. props: {
  15. line: {
  16. color: '#333333'
  17. }
  18. }
  19. })
  20. import navigate from './utils/navigate.js'
  21. Vue.prototype.$navigate = navigate
  22. Vue.config.productionTip = false
  23. App.mpType = 'app'
  24. import moment from 'moment'
  25. import 'moment/locale/zh-cn'
  26. moment.locale('zh-cn')
  27. const app = new Vue({
  28. ...App,
  29. store
  30. })
  31. // 引入请求封装,将app参数传递到配置中
  32. require('@/network/request.js')(app)
  33. app.$mount()
  34. // #endif
  35. // #ifdef VUE3
  36. import { createSSRApp } from 'vue'
  37. export function createApp() {
  38. const app = createSSRApp(App)
  39. return {
  40. app
  41. }
  42. }
  43. // #endif