main.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import Vue from 'vue'
  2. import Cookies from 'js-cookie'
  3. import 'normalize.css/normalize.css' // a modern alternative to CSS resets
  4. import Element from 'element-ui'
  5. import './styles/element-variables.scss'
  6. import '@/styles/index.scss' // global css
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import './icons' // icon
  11. import './permission' // permission control
  12. import './utils/error-log' // error log
  13. import * as filters from './filters' // global filters
  14. const organizeID = 1 // 组织ID
  15. const simplePwd = '123456' // 简单密码
  16. /**
  17. * If you don't want to use mock-server
  18. * you want to use MockJs for mock api
  19. * you can execute: mockXHR()
  20. *
  21. * Currently MockJs will be used in the production environment,
  22. * please remove it before going online! ! !
  23. */
  24. /* import { mockXHR } from '../mock'
  25. if (process.env.NODE_ENV === 'production') {
  26. mockXHR()
  27. } */
  28. Vue.use(Element, {
  29. size: Cookies.get('size') || 'medium' // set element-ui default size
  30. })
  31. // register global utility filters
  32. Object.keys(filters).forEach(key => {
  33. Vue.filter(key, filters[key])
  34. })
  35. Vue.prototype.organizeID = organizeID
  36. Vue.prototype.simplePwd = simplePwd
  37. Vue.config.productionTip = false
  38. new Vue({
  39. el: '#app',
  40. router,
  41. store,
  42. render: h => h(App)
  43. })