Passing component name to createElement doesn't compile component #7838
-
This worked in Vue 2 and I'm not sure if it's a bug or, more likely, I'm just missing something. I have an instance where I need to compile a component and if it has child data, I need to render the same component recursively. The component element gets injected but not rendered. Here's a deliberately very dumbed-down version to demonstrate the issue: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Rendering components recursively is really too dangerous, but I still provide a demo, I don't know if it meets your needs, I hope you can control the recursive exit conditions. (The ternary expression in this example is a simple recursive exit condition). |
Beta Was this translation helpful? Give feedback.
-
The main reason is that the |
Beta Was this translation helpful? Give feedback.
demo
The main reason is that the
list-item
in the render function is treated as a native tag, and you need to save the component through a variable and use it.