3ea9b19069955dbf3e84fab6a68ab0032f491fee.svn-base 1.8 KB

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