element清除数据和校验效果

2021-07-20  本文已影响0人  xintop

element dialog对话框关闭后需要清除from表单的数据和校验,可以使用以下方法

<el-dialog
  title="会议信息"
  :visible.sync="editTemplate"
  width="900px"
  :close-on-click-modal="false"
  @close="resetForm('editForm')"
>

<el-button @click="resetForm('editForm')" id="resetBut">取消</el-button>

方法:

resetForm(formName) {
  this.$refs[formName].resetFields();
  this.editTemplate = false;
},
上一篇 下一篇

猜你喜欢

热点阅读