<!--开启@open="openAddCar()"事件 Dialog 打开的回调-->
<el-dialog :title="title" :visible.sync="addCarVisible" width="50%"
:before-close="handleCancel" :close-on-click-modal="false" @open="openAddCar()">
<!--form开启 ref="car-->
<el-form label-position="right" label-width="100px" :model="car" :rules="rules" ref="car" style="padding: 0px 70px 0px 10px;" class="demo-ruleForm">
<!-- resetField 对该表单项进行重置,将其值重置为初始值并移除校验结果-->
openAddCar() {
this.$nextTick(function () {
this.$refs['car'].resetFields();
this.imageUrl = '';
for (var key in this.entity) {
if (this.entity.hasOwnProperty(key)) {
this.entity[key] = '';
}
}
});
},
ElementUI之开启Dialog时重置表单
最新推荐文章于 2024-03-19 14:47:47 发布