-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
types: allow (almost) anything in VNodeChildrenArrayContents #8498
Labels
Comments
This is needed even more since #8946 was merged, now you can't even do h('div', [this.$slots.default]) |
4 tasks
KaelWD
added a commit
to KaelWD/vue
that referenced
this issue
Dec 6, 2018
12 tasks
yyx990803
pushed a commit
that referenced
this issue
Dec 10, 2018
loong-moon
pushed a commit
to loong-moon/vue
that referenced
this issue
Dec 11, 2018
f2009
pushed a commit
to f2009/vue
that referenced
this issue
Jan 25, 2019
aJean
pushed a commit
to aJean/vue
that referenced
this issue
Aug 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this feature solve?
The Vue runtime allows pretty much anything to be put into the children array, and simply strips away
boolean | null | undefined
:vue/src/core/vdom/helpers/normalize-children.js
Line 48 in 48acf71
The types on the other hand only allow
string
,VNode
, or another nested array, which means we can't use short-circuit expressions to conditionally render things.What does the proposed API look like?
Add a separate type for
createElement
that also allowsboolean | null | undefined
, that wayvnode.children
can still be the current normalised version.The text was updated successfully, but these errors were encountered: