Vue使用axios Cannot read property 'protocol' of undefined!

当url是undefined时

当使用Vue.use(axios)时,

 

 

正确使用

main.js引入
import axios from 'axios'
Vue.prototype.$http = axios

组件中使用:
this.$http.post()

posted @ 2021-12-06 10:47  poder  阅读(85)  评论(0)    收藏  举报