main.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import Vue from 'vue'
  2. import App from '@/App'
  3. // import SuperFlow from 'vue-super-flow'
  4. // import 'vue-super-flow/lib/index.css'
  5. import router from '@/router' // api: https://github.com/vuejs/vue-router
  6. import store from '@/store' // api: https://github.com/vuejs/vuex
  7. import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie
  8. import '@/element-ui' // api: https://github.com/ElemeFE/element
  9. import '@/icons' // api: http://www.iconfont.cn/
  10. import '@/element-ui-theme'
  11. import '@/assets/scss/index.scss'
  12. import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
  13. import { isAuth } from '@/utils'
  14. import cloneDeep from 'lodash/cloneDeep'
  15. import SuperFlow from './views/modules/common/vue-super-flow/index'
  16. import html2pdf from '@/api/pdf'
  17. import Print from 'vue-print-nb'
  18. Vue.use(VueCookie)
  19. Vue.use(SuperFlow)
  20. Vue.use(html2pdf)
  21. Vue.use(Print)
  22. Vue.config.productionTip = false
  23. // 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
  24. if (process.env.NODE_ENV !== 'production') {
  25. require('@/mock')
  26. }
  27. // 挂载全局
  28. Vue.prototype.$http = httpRequest // ajax请求方法
  29. Vue.prototype.isAuth = isAuth // 权限方法
  30. // 保存整站vuex本地储存初始状态
  31. window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
  32. /* eslint-disable no-new */
  33. new Vue({
  34. el: '#app',
  35. router,
  36. store,
  37. template: '<App/>',
  38. components: { App }
  39. })