Vue router guards
package for simplify working with guard in vue router
- Install
npm i -S vue-router-guards
- Initialize pipeline
; const pipeline = ;
- Guard example
; { ifuser return true; return false "/login"; }
- Use guard
pipeline;
- Pass execute method of pipeline in router hook
router;
or
router;
- Nuances
- Guards executes in order
- On first failure subsequent guards will not be executed