(HELP)使用push({name:"xxx"})时报错,push({path:"xxx"})时不报错 #2196
Unanswered
vanker-x
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
大家好,我是vue-router的初学者
有一个问题想问一下大家,我通过router.push导航路由时,如果是通过的name参数导航就无法进入beforeEach钩子,如果是通过path参数导航时就能过正常进入beforeEach去加载动态路由
下面是我的环境信息
OS: macos
dependencies:
"@ant-design/icons-vue": "^7.0.1",
"ant-design-vue": "^4.1.2",
"axios": "^1.6.8",
"lodash-es": "^4.17.21",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
以下是我相关的代码片段
router/index.js
views/Home.vue
router/tools.js
调用handleClick时,dev-tools的console提示
Beta Was this translation helpful? Give feedback.
All reactions