State manager
Standard event handling
In a normal situation, for integration, it is enough to pass a variable to v-model
<v-select
:options="$store.state.options"
v-model="$store.state.selected"
></v-select>
Additional event handling
If you need additional actions when changing a variable, you can use the combination value
prop and update:model-value
event.
<v-select
@update:model-value="customHandler"
:options="$store.state.options"
:value="$store.state.selected"
></v-select>
customHandler(val) {
// Некоторые действия и вызов мутации
this.$store.commit("setActiveBook", val);
}