Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Nested checkbox #12

Open
gamcoh opened this issue Oct 30, 2018 · 1 comment
Open

Nested checkbox #12

gamcoh opened this issue Oct 30, 2018 · 1 comment

Comments

@gamcoh
Copy link

gamcoh commented Oct 30, 2018

I put the checkbox component inside another component and i try to do a v-model on the last one but when i do, the value is always going to be the last checkbox checked even if i make my property an array.

in the other component:

<checkbox ref="checkbox" @input="updateInput()" :value="id"></checkbox>
...
updateInput () {
  let val = this.$refs.checkbox.value
  this.$emit('input', val)
}

And in my other file who calls the component:

<my-component v-model="checkboxValues.items" id="24"/>
...
checkboxValue: {
  items: []
}
@sgaydonohl
Copy link

i was actually confronted to the same issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants