
情境:有個彈出框dialog,里面是個表單,你想關閉的時候清空所填內容~

Dialog 組件有個關閉時的回調函數close:

//關閉dialog,重置表單
resetRegisterForm(){
//得到表單實例,並調用表單重置方法resetFields()
this.$refs.registerFormRef.resetFields();
}


表單重置生效必備條件(不注意就會入坑):
1、el-form定好屬性ref;
2、el-form-item必須定義prop屬性;
3、data中必須定好rules驗證規則
