Open
Description
Version
3.2.33
Reproduction link
Steps to reproduce
- Bind a non-boolean, truthy value to a checkbox using v-model
- Observe that the checkbox is, in fact, not checked
What is expected?
v-model, at least in Vue 2, used to work fine with checkboxes using truthy and falsy values instead of strict boolean values. So I would expect this behavior to continue in Vue 3, especially since this isn't listed as a breaking change, which it definitely is.
What is actually happening?
Vue only checks the checkbox if the corresponding v-model has the boolean value of true. It ignores all else.
Case in point, I am working with an API that returns boolean-like values as 0/1 instead of true/false, for reasons of SQL. This was never an issue with Vue 2. I am aware of the true-value and false-value attributes but that shouldn't be necessary... right?