在 form 中使用 <button type="reset">rest</button>
浏览器在清空 input 等表单的 value 的时候,观察 vue 中的 data 未响应此变化。
作为浏览器的基础行为,是否可以考虑在 reset 后,也将表单上附加的 v-model 的 data 给 reset 掉?
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 :smile:
About the question, you can handle the reset event like this. Hope this helps!
thanks, I konw that way can handle the reset event, but can not auto rest v-model
You can write a directive that listens to the reset
event and finds and triggers input
& change
on every input element inside the form.
Most helpful comment
You can write a directive that listens to the
reset
event and finds and triggersinput
&change
on every input element inside the form.