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

input is encapsulated into components, its parent component monitors the change event to trigger the time prematurely, at 2.4.4 will not #6805

Closed
zWingz opened this issue Oct 13, 2017 · 0 comments

Comments

@zWingz
Copy link

zWingz commented Oct 13, 2017

Version

2.5.0

Reproduction link

https://jsfiddle.net/50wL7mdz/68600/

Steps to reproduce

当checkbox被封装成组件后,并使用'v-on="$listeners"'绑定监听事件时
父组件对其监听'onchange'事件,触发时机早于checkbox的值修改之前,
导致获取不到正确的值,
只能对其监听原生'change'事件,或者使用'nextTick'来获取最新的值
此类情况在v2.4.4 没有出现.
可以修改通过修改vue版本得到重现
来自谷歌翻译

When the checkbox is encapsulated as a component and uses the 'v-on = "$ listeners"' binding when listening events
The parent component listens to its 'onchange' event, triggers the time before the value of the checkbox is modified,
Resulting in the lack of the correct value,
Only listen to the original 'change' event, or use 'nextTick' to get the latest value
Such a situation does not appear in v2.4.4.
Can be modified by modifying the vue version to be reproduced
From Google Translate

What is expected?

父级组件'onchange'应该在value正确得到修改之后触发.

The parent component 'onchange' should be triggered after the value has been modified correctly.

What is actually happening?

父级组件'onchange'事件在value修改之前就被触发.导致无法拿到正确值,只能通过'nextTick'获取.

The parent component 'onchange' event is triggered before the value is modified, resulting in the inability to get the correct value and can only be obtained by 'nextTick'.


这种情况在2.4.4没有出现.
导致两个版本无法兼容

This situation did not occur in 2.4.4.
Resulting in two versions that are not compatible

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

1 participant