vuejs / router

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

docs: rewrite the Named Routes page #2176

Closed skirtles-code closed 6 months ago

skirtles-code commented 6 months ago

There are several problems I was trying to address:

  1. Named routes are used in earlier pages, particularly the Nested Routes and Programmatic Navigation pages, which use them quite heavily.
  2. The list of advantages comes too soon. A reader will struggle to understand that list until they have seen the example.
  3. Advantage 2 on the list mentions encoding/decoding. As far as I can tell, that should just be encoding, as named routes don't impact decoding.
  4. Advantage 4 stops mid-sentence. Bypassing path ranking (e.g. to display a ).
  5. The linked example is for Vue 2.

While I've reworded and reordered much of the page, the material covered should be the same.

I've tweaked the example to use name: 'profile', rather than name: 'user'. This was to avoid the name coinciding with the /user/ prefix on the path. These kinds of naming coincidences can (in general) lead to beginners misunderstanding what is significant and what isn't, and it seemed unnecessary to risk any confusion here.

netlify[bot] commented 6 months ago

Deploy Preview for vue-router ready!

Name Link
Latest commit 4ba875137ae9d6095daa75b146ad3df5a9646d7c
Latest deploy log https://app.netlify.com/sites/vue-router/deploys/65f5f4f933964900082316ca
Deploy Preview https://deploy-preview-2176--vue-router.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 97 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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