element表单重置
程序员文章站
2022-05-04 16:53:43
...
当使用添加的对话框表单时使用来重置表单数据
this['formName'] = {} this.$nextTick(() => {
this.$refs['formName'].resetFields()
})
编辑的时候需要重置时使用
this.$nextTick(() => {
this.$refs['form'].clearValidate()
})
还有网上找的这个办法,但是我使用的时候会把我的表单验证去掉
resetForm(formName) {
this[formName] = {};
this.$nextTick(() => {
this.$refs[formName].resetFields()
});
},
上一篇: 正则表达式的优化全面详解( 三江小渡)
下一篇: Maven打Jar 合包 采坑