vue-slider-component
vue-slider-component copied to clipboard
@change event store the last value
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)
@change receives the first parameter as the latest value.
https://stackblitz.com/edit/vitejs-vite-i1wysq?file=src%2FApp.vue
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.