vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.77k stars 1.16k forks source link

docs: explain per-route guards on nested routes #2130

Closed skirtles-code closed 5 months ago

skirtles-code commented 5 months ago

While working on #2127, I had originally intended to include a note about per-route guards, but the specific functionality I was trying to reference doesn't appear to be documented, so I left it out.

This PR attempts to address that.

Specifically, when using nested routes, the beforeEnter per-route guard can be placed on either the parent or the child route. There is some subtlety to exactly when those guards will be called, which I believe is intentional and worth documenting.

I've also moved the final paragraph of that section into a tip. The new content about nested routes left that final paragraph feeling like a strange jump to a separate topic, and I think the tip box makes that less confusing.

netlify[bot] commented 5 months ago

Deploy Preview for vue-router ready!

Name Link
Latest commit 46eeec56786c399db047012c39a6365c540af6d1
Latest deploy log https://app.netlify.com/sites/vue-router/deploys/65c1cc9334d73b000768e555
Deploy Preview https://deploy-preview-2130--vue-router.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.