-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Set value to defineModel twice in child component not working as intended #10990
Comments
sorry, i intended to zeroing the value to compare the effect. |
number.value = 0;
- number.value += 1;
+ nextTick(() => {
+ number.value += 1;
+ }); |
ah, thanks. i used emit before so i am not aware of this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.4.27
Link to minimal reproduction
https://play.vuejs.org/#eNp9Uslq40AQ/ZWmL3GIRzYzAwMe2cxCDjOQhSTHhiBLZUdJq7vpRTEI/XuqWpEskeUgJNV7r9bX8N/GJHUAvuKpy21pPHPgg9kIK1RZGW09a5iFHWvZzuqKnSD55OcI/asr8wolC/qhdB2Dnlwr55mqtpatKc9seRqxdNGVi4ViwENlZOYhRhhLY+L6S6ULkGvBKYXgmzTWiJx0MUj4nHuHpXblPnl0WuE4DSURPEd2KcFeGV9iK4KvWEQIy6TUz/9jzNsA8z6eP0D+9E780R0oJvi1BQe2BsEHzGd2D76Dz28v4YDfA4gzBInsT8AbcFoG6rGj/QmqwLZHvNjtv7j0Uu3v3PnBg3L9UNQoMdvIFxyPQIv6aPRju9+S71EnVItb7A/41g8TN8zZc+bzh4kp8Iz9tUO1Bbp3AbtSwQVdcNbgTxakX7FlixaYUG/QX0d3DHmyorjsU81O2XrT9d9pkjqTARBZomIaPDuLSfogZn+XPMQjHxdw9CSqR34kNzqTqU2nwzU2/YxtiyKCImlrp++RCIuNdDTwID3KgvdasV+5LPMntPwwP/oev9NFR0DyyPpC4dnua7BkBTwb3jP5+oO3LzmTTbg=
Steps to reproduce
click the add button.
What is expected?
number value should the same as numberRef value.
What is actually happening?
when i set defineModel value to 0, somehow is ignored because there is another setter. and it never set to 0 and the value is incrementing. but if the increment line removed, it is set to 0.
System Info
No response
Any additional comments?
is there racing condition between parent and child when sync? should i use emit instead defineModel?
The text was updated successfully, but these errors were encountered: