Which difference make possible in Vue 3 recursive component can be rendered without specifying name
explicitly?
#9584
dante01yoon
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings.
In Vue2, you can't render self-reference recursive component without
name
option specified.Take a look example component
TreeNode
below .Code-sandbox
And data structure
if you omit
name
, your component looks like will be shown like below.In Vue3, If component don't reference self with
<component :is="TreeNode">
, you can simply omit your name.I wonder What makes this difference in Vue2, Vue3 name inference ?
Also, want to know details why
<component :is="TreeNode">
also can't be implicitly inferred in Vue3.Beta Was this translation helpful? Give feedback.
All reactions