Click the buttons, the template is updated with appropriate boolean values, but v-if doesn't work as expected
What is expected?
v-if should dereference the refs and show/hide the child components accordingly
What is actually happening?
seems v-if doesn't dereference and treats the ref as truthy value
System Info
No response
Any additional comments?
I've encountered this in my code, and this is an example from a stackoverflow question where someone cannot understand why v-if doesn't work. If that's not a bug but expected behavior, could anyone point to the corresponding documentation paragraph? Anyway it looks not natural since in the other place in the template the refs are dereferenced OK.
Vue version
3.3.4
Link to minimal reproduction
Vue SFC Playground
Steps to reproduce
Click the buttons, the template is updated with appropriate boolean values, but
v-if
doesn't work as expectedWhat is expected?
v-if
should dereference the refs and show/hide the child components accordinglyWhat is actually happening?
seems
v-if
doesn't dereference and treats the ref as truthy valueSystem Info
No response
Any additional comments?
I've encountered this in my code, and this is an example from a stackoverflow question where someone cannot understand why
v-if
doesn't work. If that's not a bug but expected behavior, could anyone point to the corresponding documentation paragraph? Anyway it looks not natural since in the other place in the template the refs are dereferenced OK.