VueBUG——Uncaught Error: Provided config url is not valid

x33g5p2x  于2022-02-12 转载在 Vue.js  
字(0.6k)|赞(0)|评价(0)|浏览(523)

Uncaught Error: Provided config url is not valid

记录一个BUG,因为之前vue项目中在main.js使用了Vue.use(axios)而出现的

错误详情

  1. Uncaught Error: Provided config url is not valid
  2. at Axios.request (Axios.js?0a06:40:1)
  3. at wrap (bind.js?1d2b:9:1)
  4. at Function.Vue.use (vue.runtime.esm.js?2b0e:5123:1)
  5. at eval (main.js?56d7:11:1)
  6. at Module../src/main.js (app.js:1088:1)
  7. at __webpack_require__ (app.js:854:30)
  8. at fn (app.js:151:20)
  9. at Object.1 (app.js:1113:18)
  10. at __webpack_require__ (app.js:854:30)
  11. at checkDeferredModules (app.js:46:23)

解决方法:axios不需要install,所以Vue.use(axios)是非法的。

还有一种方式是

  1. import axios from 'axios'
  2. import VueAxios from 'vue-axios'
  3. Vue.use(VueAxios,axios);

相关文章

最新文章

更多