Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined
1:浏览器报错
Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined
浏览器报错.png
2:源码
错误的:
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:原因:
有个先后问题,谁在前,依赖前置问题,自己的结论,未必对。没深入探索。
作者:麦壳儿UIandFE2
链接:https://www.jianshu.com/p/99574ff06368
點擊查看更多內(nèi)容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦