vuejs / router

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

docs: expand installation.md #2071

Closed skirtles-code closed 10 months ago

skirtles-code commented 10 months ago

There were a few preliminaries that I felt were missing from the Installation page. I'm not sure how many people actually read that page, but at least the extra information will be explicitly stated for anyone who does.

I imagine this page will undergo significant changes when the docs are rewritten next year, but I thought it was worth making these additions now.

  1. I've explicitly noted that VueRouter is exposed as a global object when using the global build.
  2. I've added installation instructions for pnpm, alongside npm and yarn. To keep things concise, this is wrapped in a VitePress code group, similar to how commands like these are presented in the Vite docs.
  3. I've tried to encourage newcomers to use create-vue instead.
  4. I've added a note about how to access Vue Router via ES modules. I know this seems super obvious to anyone with JS experience, but the early docs examples are currently using the CDN approach and we get a steady stream of confused people on Vue Land who don't seem to understand the relationship between the global and ESM builds.
netlify[bot] commented 10 months ago

Deploy Preview for vue-router ready!

Name Link
Latest commit bb6eef9afe3ab362af8bf5c6131a8351f572a3a0
Latest deploy log https://app.netlify.com/sites/vue-router/deploys/6570b3c5ccb9c4000877d1e8
Deploy Preview https://deploy-preview-2071--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.