main.js 962 B

1234567891011121314151617181920212223242526272829303132
  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from 'vue'
  4. import ElementUI from 'element-ui'
  5. import 'element-ui/lib/theme-chalk/index.css'
  6. import App from './App'
  7. import router from './router'
  8. import './assets/css/bass.css'
  9. import './assets/css/common.css'
  10. import './assets/iconfont/iconfont.css'
  11. import axios from 'axios'//1.
  12. import Apiconfig from './apiconfig/api-config.js'
  13. import qs from 'qs'
  14. Vue.config.productionTip = false
  15. Vue.use(ElementUI);
  16. Vue.prototype.urlApi = Apiconfig;
  17. Vue.prototype.$axios = axios;//2.通过一二两个步骤可以在全局使用axios工具
  18. Vue.prototype.$qs = qs;
  19. /* eslint-disable no-new */
  20. new Vue({
  21. el: '#app',
  22. router,
  23. components: { App },
  24. template: '<App/>'
  25. })
  26. /*通过注入路由器,我们可以在任何组件内
  27. 通过 this.$router 访问路由器,也可以
  28. 通过 this.$route 访问当前路由:*/