报错信息:[Vue warn]: Error in v-on handler: “Error: Provided config url is not valid” 我想这篇文章能够帮助到你

在项目中使用新增和编辑功能模块的时候,接口的测试均没问题,但是始终报错。

我一开始以为是Axios的配置路径的问题,又重新更换了Axios的版本,包括网上常见的引入错误,均没办法处理

PS:好多人的文章真的解决不了问题

当然我也是给大家提供一个参考方法, 万一你的问题和我一样呢?

BUG截图

image-20230413140528718

详细的BUG信息

[Vue warn]: Error in v-on handler: "Error: Provided config url is not valid"

found in

---> <ElButton> at packages/button/src/button.vue
       <ElDialog> at packages/dialog/src/component.vue
         <User> at src/views/User.vue
           <ElMain> at packages/main/src/main.vue
             <ElContainer> at packages/container/src/main.vue... (1 recursive calls)
               <Home> at src/views/Manage.vue
                 <App> at src/App.vue
                   <Root>
Error: Provided config url is not valid
	    at Axios.request (Axios.js:40:1)
	    at VueComponent.wrap [as request] (bind.js:9:1)
	    at VueComponent.save (User.vue:159:1)
	    at invokeWithErrorHandling (vue.runtime.esm.js:3017:1)
	    at VueComponent.invoker (vue.runtime.esm.js:1815:1)
	    at invokeWithErrorHandling (vue.runtime.esm.js:3017:1)
	    at Vue.$emit (vue.runtime.esm.js:3716:1)
	    at VueComponent.handleClick (element-ui.common.js:9465:1)
	    at invokeWithErrorHandling (vue.runtime.esm.js:3017:1)
	    at HTMLButtonElement.invoker (vue.runtime.esm.js:1815:1)
logError @ vue.runtime.esm.js:3049
globalHandleError @ vue.runtime.esm.js:3041
handleError @ vue.runtime.esm.js:3008
invokeWithErrorHandling @ vue.runtime.esm.js:3024
invoker @ vue.runtime.esm.js:1815
invokeWithErrorHandling @ vue.runtime.esm.js:3017
Vue.$emit @ vue.runtime.esm.js:3716
handleClick @ element-ui.common.js:9465
invokeWithErrorHandling @ vue.runtime.esm.js:3017
invoker @ vue.runtime.esm.js:1815
original_1._wrapper @ vue.runtime.esm.js:7473	

最后发现在Vue页面中,this.request多加了一个()导致路径错误!唉,愚蠢

image-20230413140344824

附上错误信息部分源码,供参考

image-20230413141314603

如果这篇文章帮助到您了,请考虑给我一个点赞!

扫描二维码关注公众号,回复: 15551492 查看本文章

猜你喜欢

转载自blog.csdn.net/qq_43921353/article/details/130130447