zl程序教程

您现在的位置是:首页 >  大数据

当前栏目

清空el-form表单数据(整理)

数据 整理 表单 Form 清空 el
2023-09-14 09:04:05 时间
<!-- 添加险种开始 -->
<el-dialog destroy-on-close title="添加业务事项" :visible.sync="mattersShow" class="add-video-dialog mattersBox"
	width="45%" v-if="mattersShow">
	<el-form :model="mattersForm" ref="mattersForm" label-width="8vw">
		<el-form-item label="业务事项">
			<el-select v-model="mattersForm.name" placeholder="请选择">
				<el-option label="在职" value="1"></el-option>
				<el-option label="离职" value="2"></el-option>
			</el-select>
		</el-form-item>
		<el-form-item class="create211 margin-top50">
			<el-button type="blue" style="margin-left: 0px;" @click="submitDeadline('mattersForm')">保存
			</el-button>
			<el-button type="grey" style="margin-left: 30px;" @click="cancelClick('mattersForm')">取消
			</el-button>
		</el-form-item>
	</el-form>
</el-dialog>
<!-- 添加险种结束 -->
方法一:this.mattersForm = this.$options.data().mattersForm  // 置空表单,mattersForm是表单的数据对象

方法二:v-if="mattersShow"
	在el-dialog标签上添加v-if="mattersShow"  :visible.sync="mattersShow"

在这里插入图片描述