Passing boolean value to render function children renders empty node instead
Vue version
3.2.26
Link to minimal reproduction
https://stackblitz.com/edit/vue-baopmh?file=src%2FApp.js
Steps to reproduce
- According to the docs,
Children
can be any ofstring
,number
,boolean
, etc - Supply a boolean value as the children for the render function
What is expected?
It will render the boolean value in the template (e.g. true
or false
) regardless of the boolean value
What 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.
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 (true
or false
) which isn't the case.
seems it works only in template
that the compiler will wrap booleans with toDisplayString
.
Check JS on the right: Vue SFC playrgound
see https://github.com/vuejs/core/issues/574 I feel the docs should be updated. @LinusBorg WDYT