Vue2.0 axios报错: Cannot read property 'protocol' of undefined

来源:互联网 发布:高一英语听力软件 编辑:程序博客网 时间:2024/06/06 05:16

错误代码如下:(但是项目还是可以run)

Uncaught (in promise) TypeError: **Cannot read property 'protocol' of undefined**

解决方法:注释掉Vue.use(axios)

import axios from 'axios'//Vue.use(axios)Vue.prototype.$http = axios

对比一下 vue-resource

import VueRes from 'vue-resource';Vue.use(VueRes);
阅读全文
2 0
原创粉丝点击