vue.use(router) vue.use(axios,VueAxios) 之后就出现这个错误,注释axios这行之后又不报错了,什么原因?
发布于 8 年前 作者 dino_xie 5949 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

index.js:

import Vue from ‘vue’ import Router from ‘vue-router’ import axios from ‘axios’ import VueAxios from ‘vue-axios’

Vue.use(Router) Vue.use(axios, VueAxios)

错误信息: Uncaught (in promise) TypeError: Cannot read property ‘protocol’ of undefined at isURLSameOrigin (eval at <anonymous> (app.js:977), <anonymous>:57:21) at dispatchXhrRequest (eval at <anonymous> (app.js:814), <anonymous>:108:50) at xhrAdapter (eval at <anonymous> (app.js:814), <anonymous>:12:10) at dispatchRequest (eval at <anonymous> (app.js:914), <anonymous>:52:10)

回到顶部