docs icon indicating copy to clipboard operation
docs copied to clipboard

Conflicting details on async components with vue router

Open sanscheese opened this issue 3 years ago • 2 comments

The vue docs appear to conflict with vue router's advice on using async components for routes.

"Do not use Async components for routes. Async components can still be used inside route components but route component themselves are just dynamic imports." from Vue Router Docs

sanscheese avatar Jul 29 '22 14:07 sanscheese

Deploy Preview for vuejs ready!

Name Link
Latest commit ab194de38320fcc42b5dcea33bf229123cccffda
Latest deploy log https://app.netlify.com/sites/vuejs/deploys/62e7f33b801d230008a0381c
Deploy Preview https://deploy-preview-1869--vuejs.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 settings.

netlify[bot] avatar Jul 29 '22 14:07 netlify[bot]

@skirtles-code agree would be better to guide best practice here. In Vue 2 I used to follow Chris fritz' approach: https://github.com/bencodezen/vue-enterprise-boilerplate/blob/main/src/router/routes.js#L99

But I'm not sure what is the best minimal example to suggest or reference for asynchronous loading routes in Vue 3 with Vite.

sanscheese avatar Jul 30 '22 15:07 sanscheese

I've made a change to the wording in #1896, now merged. I think that addresses the concerns raised here while keeping as close to the original meaning as possible.

Thanks again!

skirtles-code avatar Aug 18 '22 02:08 skirtles-code