Vue routing guards beforeRouteEnter, beforeRouteUpdate, beforeRouteLeave do not take effect

Recently, it is necessary to use routing guards in the project to judge that the routing returns to the specified page, and it will not take effect in the process of using subcomponents.
insert image description here

Routing components refer to the components used in the routes.js file. Subcomponents and ordinary components are not routing components, so the routing guard hook function will not take effect.

Reference: https://www.cnblogs.com/baifangzi/p/14481820.html

Guess you like

Origin blog.csdn.net/xiaoxiannvh/article/details/130085489