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

关于 form 的 reset 功能 #3426

Closed
lmnsg opened this issue Aug 11, 2016 · 3 comments
Closed

关于 form 的 reset 功能 #3426

lmnsg opened this issue Aug 11, 2016 · 3 comments

Comments

@lmnsg
Copy link

lmnsg commented Aug 11, 2016

在 form 中使用 <button type="reset">rest</button>
浏览器在清空 input 等表单的 value 的时候,观察 vue 中的 data 未响应此变化。

作为浏览器的基础行为,是否可以考虑在 reset 后,也将表单上附加的 v-model 的 data 给 reset 掉?

@posva
Copy link
Member

posva commented Aug 11, 2016

Hi!

Please follow the Issue Reporting Guidelines. Make sure to ask questions on the forums or the gitter chat. We keep questions out of issues 😄

About the question, you can handle the reset event like this. Hope this helps!

@posva posva closed this as completed Aug 11, 2016
@lmnsg
Copy link
Author

lmnsg commented Aug 16, 2016

thanks, I konw that way can handle the reset event, but can not auto rest v-model

@yyx990803
Copy link
Member

yyx990803 commented Aug 16, 2016

You can write a directive that listens to the reset event and finds and triggers input & change on every input element inside the form.

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