vue-switches icon indicating copy to clipboard operation
vue-switches copied to clipboard

Avoid mutating a prop

Open jillztom opened this issue 7 years ago • 1 comments

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.

jillztom avatar Sep 21 '17 19:09 jillztom

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.

AndreKR avatar May 17 '18 04:05 AndreKR