Skip to content

Commit

Permalink
fix: Q-Select with v-model and Vuex not emitting events #517
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Apr 27, 2017
1 parent 8a9dc10 commit 0496337
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dev/components/form/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div>
<div class="layout-padding">
<p class="caption">With Radios</p>
<q-select type="radio" v-model="select" :options="selectOptions"></q-select>
<q-select type="radio" v-model="select" :options="selectOptions" @input="inputChanged"></q-select>
<p class="caption">With Checkboxes</p>
<q-select type="checkbox" v-model="multipleSelect" :options="selectOptions"></q-select>
<q-select type="checkbox" v-model="multipleSelect" :options="selectOptions" @input="inputChanged"></q-select>
<p class="caption">With Toggles</p>
<q-select type="toggle" v-model="multipleSelect" :options="selectOptions"></q-select>
<p class="caption">With List</p>
Expand Down Expand Up @@ -131,6 +131,11 @@ export default {
}
]
}
},
methods: {
inputChanged (v) {
console.log('input:', v)
}
}
}
</script>
8 changes: 8 additions & 0 deletions src/vue-components/select/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ export default {
disable: Boolean,
delimiter: Boolean
},
watch: {
model: {
deep: true,
handler (val) {
this.$emit('input', val)
}
}
},
computed: {
model: {
get () {
Expand Down

0 comments on commit 0496337

Please sign in to comment.