Nested components in CDN #8802
-
I have created two separate components which work on their own, but find it impossible to nest one into another. All of discussions online are about downloaded Vue and not CDN, or ABOUT simple nested components declared inside one component. Does anyone know any reading material regarding the issue or can point to a sample. Btw, the nested component will be dynamically used, sometimes omitted. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Can you link to a playground with an example that doesn't work as you would expect it to? The official documentation mentions loading components asynchronously, have you tried that? I don't see why it wouldn't also work from a CDN 🤷♀️. |
Beta Was this translation helpful? Give feedback.
-
After a long day of reading I came with sort of solution. With my laymans explanation, full download of Vue includes webpack, while CDN doesn't. And to import/export you need js to be of type module. That is covered in webpack but not in js without that "module" type. And making your Vue component a module brings down some other problems. In the end I made locally declared component inside my main component, and using async mounted() method as a main function for everything. |
Beta Was this translation helpful? Give feedback.
After a long day of reading I came with sort of solution. With my laymans explanation, full download of Vue includes webpack, while CDN doesn't. And to import/export you need js to be of type module. That is covered in webpack but not in js without that "module" type. And making your Vue component a module brings down some other problems.
In the end I made locally declared component inside my main component, and using async mounted() method as a main function for everything.