Hello, found this when I was trying to write unit tests for my module:
https://jsfiddle.net/iFarmGolems/cxc8cp34/
Why is this happening?
in 2.0 works fine
This happens because the change event fires before the DOM gets a chance to update. Therefore, the v-model updates the value on that change event to what it was before the DOM gets a chance to update.
The solution is a nextTick.
Here's an updated fiddle that works: https://jsfiddle.net/crswll/cxc8cp34/4/
Most helpful comment
This happens because the change event fires before the DOM gets a chance to update. Therefore, the v-model updates the value on that change event to what it was before the DOM gets a chance to update.
The solution is a
nextTick.Here's an updated fiddle that works: https://jsfiddle.net/crswll/cxc8cp34/4/