vue-element关闭对话框,清除form表单校验
作者:
新篇章 | 来源:发表于
2021-01-13 10:29 被阅读0次<el-dialog :title="addDialog.title" :visible.sync="addDialog.open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"></el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitClick">确 定</el-button>
<el-button @click="cancelClick">取 消</el-button>
</div>
</el-dialog>
methods:{
cancelClick(){
this.addDialog.open = false;
//清空绑定数据
this.resetDataForm()
//清除form表单校验
this.$refs.form.resetFields();
}
}
本文标题:vue-element关闭对话框,清除form表单校验
本文链接:https://www.haomeiwen.com/subject/azcuaktx.html
网友评论