1:瀏覽器報(bào)錯(cuò)
Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined
2:源碼
錯(cuò)誤的:
Vue.use(axios,VueAxios)
修正后:
Vue.use(VueAxios,axios)
完整代碼:
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import VueAxios from 'vue-axios'
//使用組件-模塊化思想
Vue.use(VueAxios,axios)
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
render: h => h(App)
});
3:原因:
有個(gè)先后問(wèn)題,誰(shuí)在前置森,依賴(lài)前置問(wèn)題,自己的結(jié)論,未必對(duì)。沒(méi)深入探索瑞妇。