6f2eed8d8e3caa8d04be520f0f47cfb23843c93c.svn-base 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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(VueRouter)
  44. Vue.use(ElementUI, {
  45. i18n: (key, value) => i18n.t(key, value)
  46. })
  47. // register global utility filters
  48. Object.keys(filters).forEach(key => {
  49. Vue.filter(key, filters[key])
  50. })
  51. import echarts from 'echarts'
  52. Vue.use(echarts)
  53. // Vue.prototype.$echarts = echarts
  54. new Vue({
  55. el: '#app',
  56. router,
  57. store,
  58. i18n,
  59. render: h => h(App)
  60. })