VUE- routing (five) navigation guard

First, routing exclusive guard

If the home to guard path, the path is set in the home in router.js

Second, the global guard (guard all paths)

Applied to the whole route -> router in Router in mian.js, the first set so main.js

2, the global guard: beforeResolve (execution time (one layer are finished loading when things are resolved in the routing is completed))

Like with the form above router.beforeEach

3, router.afterEach () => {} executed when everything ok, no real sense, there is no argument

Routing resolution process:

https://router.vuejs.org/

to sum up:

Guess you like

Origin www.cnblogs.com/tianya-guoke/p/11519720.html