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

错误代码如下:(但是项目还是可以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);

你可能感兴趣的:(Vue,随笔)