Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@change event store the last value #673

Open
mahouha opened this issue Feb 10, 2023 · 2 comments
Open

@change event store the last value #673

mahouha opened this issue Feb 10, 2023 · 2 comments

Comments

@mahouha
Copy link

mahouha commented Feb 10, 2023

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)

@NightCatSama
Copy link
Owner

@change receives the first parameter as the latest value.

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

@plamen89
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants