docs icon indicating copy to clipboard operation
docs copied to clipboard

Enrich the registration.md documentation with an example for application-wide global registration of "App" components

Open JeremieLitzler opened this issue 1 year ago • 4 comments

Description of Problem

As I was going through the VueSchool.io courses and their original Masterclass on Vue 3, I set out to build the project using Vite, Vue 3 and TypeScript.

At the global registration lesson, I saw that the Vue 3 documentation didn't include the code snippet the Vue 2 documentation included.

Proposed Solution

The update adds a code snippet to give an example about how to dynamically import the components that we'd want to be globally available.

It was included in the Vue 2 docs, so it could be a good addition to the Vue 3 docs as well.

Inspired by https://zerotomastery.io/blog/how-to-auto-register-components-for-vue-with-vite/ but uses a older and JavaScript solution.

Additional Information

None

JeremieLitzler avatar Feb 28 '24 08:02 JeremieLitzler

Deploy Preview for vuejs ready!

Name Link
Latest commit 65e9bac45d2abaaf5e41795b0991d281e8dc35a9
Latest deploy log https://app.netlify.com/sites/vuejs/deploys/65def287677e8d000809919e
Deploy Preview https://deploy-preview-2716--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 configuration.

netlify[bot] avatar Feb 28 '24 08:02 netlify[bot]

@JeremieLitzler

Thank you for your contribution! I like the snippet but I believe it would make the component registration documentation unnecessarily complex. The old Cookbook section in the old docs would be a perfect place for such a snippet, maybe Examples could work too?

NataliaTepluhina avatar Mar 05 '24 13:03 NataliaTepluhina

@JeremieLitzler

Thank you for your contribution! I like the snippet but I believe it would make the component registration documentation unnecessarily complex. The old Cookbook section in the old docs would be a perfect place for such a snippet, maybe Examples could work too?

Do you mean here https://github.com/vuejs/docs/tree/main/src/examples ?

If so, I can see to work something out.

JeremieLitzler avatar Mar 05 '24 18:03 JeremieLitzler

@JeremieLitzler yes, I meant the Examples section (sorry for the delayed answer, I was on vacation)

NataliaTepluhina avatar Mar 17 '24 13:03 NataliaTepluhina