Dynamic component with auto imported components (component is)
See original GitHub issueEnvironment
Stackblitz
Reproduction
https://stackblitz.com/edit/nuxt3-windicss-rktywp?file=components/Dynamic.vue
Describe the bug
<component :is
doesn’t import components if they are not registered inside the dynamic component itself. From my recollection, this didn’t occur in Nuxt2.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Crank up auto import for dynamic Nuxt.js components
It prepares an array of components with their component names (PascalCase and kebab-case) and their relative filepaths. In a second step all ....
Read more >Vue 3 use dynamic component with dynamic imports
I import all the possible components that can be added into componentName . With 30 possible components, it will be a long list....
Read more >Dynamic & Async Components - Vue.js
// A dynamic import returns a Promise. () => import('./my-async-component') ) ...
Read more >Dynamic Components with Vue's 'component' - Telerik
In this article we will explore Vue's <component> , <keep-alive> and how to create dynamically loaded components.
Read more >Dynamic Imports for Components - Improving your Core Web ...
We can now import it as a dynamic component by adding the following at the beginning of the file: const CodeSampleModal = dynamic(()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You either need to set
components.global
to true, or you can specifically resolve components you need, e.g.:See https://github.com/nuxt/framework/discussions/2883.
The point is that it has to be a string so we can know to import it at build time. If you want to handle it dynamically you will need to set that component directory as a global component (or indeed all of your components as globally registered).