Skip to content

docs: 📝 clarify async components for Vue Router #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

TheDutchCoder
Copy link
Contributor

@TheDutchCoder TheDutchCoder commented Apr 24, 2021

Description of Problem

The docs around async components can be a bit confusing when people use Vue Router, hopefully this change clarifies the use of async component with Vue Router a bit.

Proposed Solution

  • Change the example of NextPage.vue to a more generic Modal.vue
  • Add a note about async components and Vue Router, with a link to the relevant section in the Router docs.

Additional Information

Relates to issue: #1013

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

We don't usually reference Vue Router in the main Vue docs but I agree that this is potentially confusing and warrants a mention.

Coming from Vue 2, I thought that async components and lazy loaded routes were effectively the same thing. I imagine a lot of people thought the same. My first reaction when I read this page was that it would be a hassle to upgrade my router config. Hopefully the extra note can help others falling into the same trap.

I've made a couple of suggestions below.

@TheDutchCoder
Copy link
Contributor Author

@skirtles-code I've updated the examples and also renamed CartFlyout.vue to a more illustrative Modal.vue, which I think is more familiar to people and makes more contextual sense.

Let me know what you think!

@skirtles-code skirtles-code linked an issue Apr 27, 2021 that may be closed by this pull request
Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I prefer Modal too.

@skirtles-code skirtles-code merged commit 4c7c1e5 into vuejs:master Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Async components and Vue Router (with PR)
3 participants