Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 路由守卫vue2 -> vue3 #385

Closed
wants to merge 1 commit into from

Conversation

AlliotTech
Copy link

和 Vue 2 不同,Vue 2 的 beforeEach 是默认三个参数,第三个参数是 next,用来操作路由接下来的跳转。

但在新版本路由里,已经通过 RFC 将其删除,虽然目前还是作为可选参数使用,但以后不确定是否会移除,不建议继续使用,点击查看原因

新版本路由可以通过 return 来代替 next。

文档: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0037-router-return-guards.md#motivation

@AlliotTech AlliotTech closed this by deleting the head repository May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant