0👍
You can’t use v-model
with vuex
when using that component. You’ll need to handle the changing of the value yourself, and use :value
for the binding capturing @input
to determine when the value changes. Observe:
<select2 @input="updateBereiche"
:options="bereiche"
:value="bereichInput"
class="form-control">
Then you’re going to add a new method called updateBereiche
methods: {
updateBereiche(value) {
this.$store.commit('setBereichInput', value)
}
}
Remove your setter
, it’s not needed anymore.
Source:stackexchange.com