Skip to content
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

nativescript-vue - v-model returns object instead of boolean #99

Open
jofftiquez opened this issue Dec 4, 2018 · 4 comments
Open

nativescript-vue - v-model returns object instead of boolean #99

jofftiquez opened this issue Dec 4, 2018 · 4 comments

Comments

@jofftiquez
Copy link
Contributor

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?

@rigor789
Copy link
Member

rigor789 commented Dec 4, 2018

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".

@jofftiquez
Copy link
Contributor Author

@rigor789 thanks for the workaround. I think this should be mentioned in the docs while the fix is not yet done. Cheers!

@rigor789
Copy link
Member

rigor789 commented Dec 4, 2018

Absolutely! Would you mind making a PR with the changes to the readme?

@jofftiquez
Copy link
Contributor Author

@rigor789 I dont mind at all. I will submit a PR then. Thanks :)

jofftiquez added a commit to jofftiquez/nativescript-checkbox that referenced this issue Dec 21, 2018
Updated as request from nstudio#99
farfromrefug pushed a commit to nativescript-community/ui-checkbox that referenced this issue Dec 2, 2024
Updated as request from nstudio#99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants