Nested component not rendering in dynamically registered external component #9673
Unanswered
mrjeanjean
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I work on a VueJs (options API) project. Here is a simplify version :
1) The library
Let say I have a component which displays a list of components called 'blocks'.
Here is the boostrap of the app. An interface to add block dynamically from the outside :
Here is the component who displays all the blocks.
2) The library consumer
For real life exemple I've built the library as es module and I use it like this :
Here is my externalBlock component :
The purpose here is to add a component dynamically and make it rendered by the library.
The problem: the ExternalBlock is well displayed BUT the nested ExternalBlockNested is not rendered at all. and I have a warn error in the console :
[Vue warn]: resolveComponent can only be used in render() or setup().
For sure I don't really understand how VueJs works under the hood, how components are really rendered...
Do I need to register my child component
ExternalBlockNested
manually (tried with no success)Is it the way I've built the library who breaks VueJs logic ?
Error reproduction here: https://stackblitz.com/edit/vitejs-vite-fwb5ma?file=src%2FExternalBlock.vue,index.html&terminal=dev
Thanks for reading
Beta Was this translation helpful? Give feedback.
All reactions