main.js 674 B

123456789101112131415161718192021222324252627282930
  1. // main.js(Vue 2)
  2. import Vue from 'vue'
  3. import App from './App.vue'
  4. import * as filters from './utils/filters.js'
  5. import store from './store'
  6. import uView from 'uview-ui'
  7. import config from '@/config/config'
  8. // 注册全局过滤器
  9. Object.keys(filters).forEach((key) => {
  10. Vue.filter(key, filters[key])
  11. })
  12. // 全局挂载变量(通过 Vue.prototype)
  13. Vue.prototype.$mainColor = config.mainColor
  14. Vue.prototype.$lightColor = config.lightColor
  15. Vue.prototype.$aiderLightColor = config.aiderLightColor
  16. // 使用 Vuex store
  17. Vue.use(store)
  18. // 使用 uView UI
  19. Vue.use(uView)
  20. Vue.config.productionTip = false
  21. new Vue({
  22. store,
  23. render: h => h(App)
  24. }).$mount('#app')