-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Passing boolean value to render function children renders empty node instead #7578
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
Comments
It seems that boolean is being skipped when rendering: So now my question is whether the docs is trying to say that boolean value is allowed but an empty node will be rendered instead, or boolean value is allowed and it's supposed to be rendering a stringified version of the boolean value ( |
seems it works only in Check JS on the right: Vue SFC playrgound |
see #574 |
a workaround: convert boolean value to string, see Playground |
@edison1105 I understand that, but you're still passing a string at the end. I think it's just the fact that the doc says you could pass in a boolean and it will be rendered, which is misleading because an empty node is rendered instead. Either the doc needs to be updated or the code needs to be updated |
Uh oh!
There was an error while loading. Please reload this page.
Vue version
3.2.26
Link to minimal reproduction
https://stackblitz.com/edit/vue-baopmh?file=src%2FApp.js
Steps to reproduce
Children
can be any ofstring
,number
,boolean
, etcWhat is expected?
It will render the boolean value in the template (e.g.
true
orfalse
) regardless of the boolean valueWhat is actually happening?
It renders empty node instead
System Info
https://stackblitz.com/edit/vue-baopmh?file=src%2FApp.js Seems to be reproducible regardless of the system
Any additional comments?
For context, the component that we're using simply renders the value it is given, and one of them represents a boolean value to be displayed in the UI. Technically we could've always parsed them to string first, but since the docs says
boolean
is allowed, we'd expect to see them rendered.The text was updated successfully, but these errors were encountered: