nativescript-vue - v-model returns object instead of boolean
Given this example:
<check-box v-model="foo"></check-box>
export default {
data() {
return {
foo: true
}
}
}
You can see that the foo was declare as true, but the check-box is not checked. Also if I tapped the checkbox and watched the foo it's value becomes an object with value field inside.
Is there a way to make it emit only a boolean value?
This is a bug in nsvue, introduced in 2.0 when we changed to functional components...
I haven't released a fix yet, but as a workaround, you can replace v-model with :checked="foo" @checkedChange="foo = $event.value".
@rigor789 thanks for the workaround. I think this should be mentioned in the docs while the fix is not yet done. Cheers!
Absolutely! Would you mind making a PR with the changes to the readme?
@rigor789 I dont mind at all. I will submit a PR then. Thanks :)