Uncaught TypeError: Cannot use ‘in‘ operator to search for ‘path‘ in undefined

Uncaught TypeError: Cannot use ‘in’ operator to search for ‘path’ in undefined

报错如下:

在这里插入图片描述

Uncaught TypeError: Cannot use 'in' operator to search for 'path' in undefined
    at resolve (vue-router.esm-bundler.js:2882:13)
    at pushWithRedirect (vue-router.esm-bundler.js:3000:51)
    at push (vue-router.esm-bundler.js:2966:16)
    at Object.install (vue-router.esm-bundler.js:3380:17)
    at Object.use (runtime-core.esm-bundler.js:3756:18)
    at main.js?t=1698041504116:9:5

解决办法:我在路由文件里用错了createWebHashHistory()方法,将它用成了变量,只需要将它写成方法即可解决问题
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_46374969/article/details/133989088