vue-manage-system icon indicating copy to clipboard operation
vue-manage-system copied to clipboard

chore: 路由守卫vue2 -> vue3

Open AlliotTech opened this issue 10 months ago • 0 comments

和 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 avatar Apr 30 '24 06:04 AlliotTech