main.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import 'babel-polyfill'
  2. import 'classlist-polyfill'
  3. import Vue from 'vue'
  4. import axios from './router/axios'
  5. import VueAxios from 'vue-axios'
  6. import App from './App'
  7. import './permission' // 权限
  8. import './error' // 日志
  9. import router from './router/router'
  10. import store from './store'
  11. import { loadStyle } from './util/util'
  12. import * as urls from '@/config/env'
  13. import { iconfontUrl, iconfontVersion } from '@/config/env'
  14. import * as filters from './filters' // 全局filter
  15. import './styles/common.scss'
  16. import basicContainer from './components/basic-container/main'
  17. // 插件 json 展示
  18. import vueJsonTreeView from 'vue-json-tree-view'
  19. import { validatenull } from '@/util/validate'
  20. Vue.prototype.validatenull = validatenull
  21. Vue.use(router)
  22. Vue.use(vueJsonTreeView)
  23. Vue.use(VueAxios, axios)
  24. // 注册全局容器
  25. Vue.component('basicContainer', basicContainer)
  26. // 加载相关url地址
  27. Object.keys(urls).forEach(key => {
  28. Vue.prototype[key] = urls[key]
  29. })
  30. //加载过滤器
  31. Object.keys(filters).forEach(key => {
  32. Vue.filter(key, filters[key])
  33. })
  34. // 动态加载阿里云字体库
  35. iconfontVersion.forEach(ele => {
  36. loadStyle(iconfontUrl.replace('$key', ele))
  37. })
  38. Vue.config.productionTip = false
  39. new Vue({
  40. router,
  41. store,
  42. render: h => h(App)
  43. }).$mount('#app')