85e6ab4c91db63bda837102f1ac79ace2a23cd40.svn-base 1.7 KB

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