Vue. component navigation guard beforeRouterEnter, beforeRouteLeave, beforeRouteUpdate detailed explanation

Component navigation guard: write a navigation guard hook function in the js of a certain component

Scope of action : only the current component
to : address to
form : where to come from

(1)beforRouteEhter: Before the component specified by the routing rule is accessed ,
Insert picture description here
write next(); execute the current page
Insert picture description here
(2)beforeRouteLeave: automatically trigger when the routing rule leaves the next parameter cannot be written
Insert picture description here
(3)beforeRouteUpdate: dynamic routing only the parameters change is Only executed (for popular understanding and when jumping to the page)
Insert picture description here

Guess you like

Origin blog.csdn.net/men_gqi/article/details/103234124