main.js 948 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 * as filters from './filters' // global filters
  13. import permission from '@/directive/permission/index.js' // 权限判断指令
  14. import Print from '@/utils/print' // 打印
  15. Vue.use(Print)
  16. Vue.use(Element, {
  17. size: Cookies.get('size') || 'medium' // set element-ui default size
  18. })
  19. Vue.directive('permission', permission)
  20. // register global utility filters.
  21. Object.keys(filters).forEach(key => {
  22. Vue.filter(key, filters[key])
  23. })
  24. Vue.config.productionTip = false
  25. new Vue({
  26. el: '#app',
  27. router,
  28. store,
  29. render: h => h(App)
  30. })