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

When the component is bundled with 'v-model', if the 'v-on = "$ listeners"' attribute is added, the 'input event' will be passed up. 'Value' is eventually '[object Event]' #6846

Closed
zWingz opened this issue Oct 18, 2017 · 1 comment

Comments

@zWingz
Copy link

zWingz commented Oct 18, 2017

Version

2.5.2

Reproduction link

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

Steps to reproduce

输入任意值.得到的是'[object Event]',并观察console
修改vue版本.重复步骤,然后观察console
翻译来自谷歌

Enter any value. Get '[object Event]' and watch console
Modify the vue version. Repeat steps. Then observe the console
Translate from Google

What is expected?

input的值为输入的值

The value of input should be the value entered

What is actually happening?

input标签将'input event'传递给父组件
导致value为[object Event]

The input tag passes 'input event' to the parent component
Causing value to be [object Event]


此情况在2.5.0之前.虽然依然会将event通过input传递给父组件.但并不影响最终结果.
在2.5.2则将会影响最终结果

This is before 2.5.0. Although the event is still passed to the parent component via input, it does not affect the final result.
At 2.5.2 will affect the final result

@yyx990803
Copy link
Member

This is a wontfix, because the emitted events need to be in correct order (as fixed in #6805). It only happened to work previously because the native event was emitted first and then overwritten by the custom event.

You can preserve the old behavior by emitting the custom event in a nextTick, so that it overwrites the native event: https://jsfiddle.net/50wL7mdz/72174/

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

No branches or pull requests

2 participants