TypeError: Cannot read property ‘protocol‘ of undefined 在写vue项目时爆出如下异常 TypeError: Cannot read property ‘protocol‘ of undefined 发生这个错误的具体具体原因是因为在main.js 中引用了axios,同时在其他的类中使用了axios的请求 解决方案 在main.js 中删除Vue.use(axios) 并添加下代码 Vue.prototype.http = axios;