main.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import Vue from 'vue'
  2. import ElementUI from 'element-ui'
  3. import App from '@/App.vue'
  4. import router from '@/router' // api: https://github.com/vuejs/vue-router
  5. import store from '@/store' // api: https://github.com/vuejs/vuex
  6. import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie
  7. import '@/icons' // api: http://www.iconfont.cn/
  8. import '@/element-ui-theme/style.css'
  9. import Avue from '@smallwei/avue' // api: https://avue.top
  10. import '@smallwei/avue/lib/index.css'
  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 axios from 'axios'
  15. // import cloneDeep from 'lodash/cloneDeep'
  16. Vue.use(Avue, { axios })
  17. Vue.use(VueCookie)
  18. Vue.use(ElementUI)
  19. Vue.config.productionTip = false
  20. // 挂载全局
  21. Vue.prototype.$http = httpRequest // ajax请求方法
  22. Vue.prototype.isAuth = isAuth // 权限方法
  23. // 保存整站vuex本地储存初始状态
  24. // process.env.VUE_APP_RESOURCES_URL['storeState'] = cloneDeep(store.state)
  25. /* eslint-disable no-new */
  26. new Vue({
  27. el: '#app',
  28. router,
  29. store,
  30. render: h => h(App)
  31. })