[英]Why i cant reset the form after getting the form's values ( vue.js / js)
您可以在推送值后通過重置反應數據來重置表單:
addnewProduct (e) {
this.list.push({value1: this.value1, value2: this.value2})
this.value1 = ""
this.value2 = ""
}
完整工作示例: Vue SFC Playgorund
$event.target.reset
是 function。 你需要執行它所以添加()
:
$event.target.reset()
順便說一句: var WindowHeight = Window.innerHeight;
僅將Window
的屬性存儲到WindowHeight
,因此這不會更改您頁面上的任何內容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.