problem description
iview slider changes the value by dragging the slider, and the on-change handler gets the new value of v-model.
but after changing the value through input input or clicking on addition or subtraction, the handler is still the old value.
the environmental background of the problems and what methods you have tried
iview-2.14.3,chrome browser
related codes
https://jsfiddle.net/yyrzhm46.
<div id="app">
<Slider v-for="(item,idx) in arr" v-model="item.value" @on-change="save(idx)" show-input>
</Slider>
</div>
new Vue({
el: "-sharpapp",
data: {
arr:[{value:11},{value:22}]
},
methods: {
save(idx){
console.log(this.arr[idx].value)
}
}
});
what result do you expect? What is the error message actually seen?
whether you drag slider or enter via input, the on-change handler should have the new value of v-model instead of the old value.