e1b6ca16fa0b98f3e3eb4160c6e0598b53fbf7b9.svn-base 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import 'normalize.css/normalize.css' // A modern alternative to CSS resets
  4. import ElementUI from 'element-ui'
  5. import 'element-ui/lib/theme-chalk/index.css'
  6. // const ElementUI = require('element-ui')
  7. // require('element-ui/lib/theme-chalk/index.css')
  8. import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
  9. import iconfont from './assets/iconfont/iconfont.css'
  10. import '@/styles/index.scss' // global css
  11. import * as Sentry from '@sentry/browser'
  12. import { Vue as VueIntegration } from '@sentry/integrations'
  13. import App from './App'
  14. import store from './store'
  15. import router from './router'
  16. import i18n from './i18n'
  17. import '@/icons' // icon
  18. import '@/permission' // permission control
  19. import './icons'
  20. import * as filters from './filters' // global filters
  21. Vue.config.productionTip = false
  22. /**
  23. * If you don't want to use mock-server
  24. * you want to use MockJs for mock api
  25. * you can execute: mockXHR()
  26. *
  27. * Currently MockJs will be used in the production environment,
  28. * please remove it before going online! ! !
  29. */
  30. // import { mockXHR } from '../mock'
  31. if (process.env.NODE_ENV === 'production') {
  32. // mockXHR()
  33. }
  34. // console.log(process.env)
  35. if (process.env.NODE_ENV !== 'development') {
  36. Sentry.init({
  37. release: 'vislib@' + process.env.npm_package_version,
  38. dsn: 'https://9d8ee0ea1a2749949dd1e641b0f7c071@o286322.ingest.sentry.io/5217806',
  39. integrations: [new VueIntegration({ Vue, attachProps: true })]
  40. })
  41. }
  42. store.commit('app/SET_LANG', 'CN')
  43. // Vue.use(ElementUI, { locale })
  44. Vue.use(VueRouter)
  45. Vue.use(ElementUI, {
  46. i18n: (key, value) => i18n.t(key, value)
  47. })
  48. // register global utility filters
  49. Object.keys(filters).forEach(key => {
  50. Vue.filter(key, filters[key])
  51. })
  52. import echarts from 'echarts'
  53. Vue.use(echarts)
  54. // Vue.prototype.$echarts = echarts
  55. new Vue({
  56. el: '#app',
  57. router,
  58. store,
  59. i18n,
  60. render: h => h(App)
  61. })