vue-switches
vue-switches copied to clipboard
Avoid mutating a prop
I'm getting the following error:
vue.esm.js?65d7:476 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "value"
found in
---> <Switches> at node_modules/vue-switch/switch.vue
The slider is working, but the v-model
value is not changing.
If you're binding to a prop, unfortunately (that's a Vue issue) you have to use <switches :value="value" @input="doSomething">
instead of v-model
.