vue-slider-component icon indicating copy to clipboard operation
vue-slider-component copied to clipboard

@change event store the last value

Open mahouha opened this issue 2 years ago • 2 comments

I have a component using vue slider, I use @change event to emit the new value to the parent component, when I log the value in @change event I note that the new value is the last one not the current and the value emmited not correct (the last) , but when I print it in a div is correct, I don't know If I have a mistake in my logic

reproduction url (see the console)

mahouha avatar Feb 10 '23 10:02 mahouha

@change receives the first parameter as the latest value.

https://stackblitz.com/edit/vitejs-vite-i1wysq?file=src%2FApp.vue

NightCatSama avatar Feb 11 '23 16:02 NightCatSama

Just ran into the same problem (in vue3) and it seems the change event is fired before the model value is updated. As a workaround you can listen for the update:modelValue event instead.

plamen89 avatar Oct 23 '23 11:10 plamen89