1.新建一个表单
<a-modal v-model="addPersonModalVisible" title="增加个人" width="550px"
@cancel="handleEditCancel"
:footer="null">
<el-form :model="addPersonData" :rules="addPersonFromRules" ref="addPersonFromRules" label-width="120px">
<el-form-item label="姓名:" label-width="200px" prop="name" width="200px">
<el-input v-model="addPersonData.name"></el-input>
<a-checkbox v-model:checked="checked">是否参加考核</a-checkbox>
</el-form-item>
<el-form-item label="备注:" label-width="200px" prop="remark" width="200px">
<a-textarea v-model="addPersonData.REMARK" :rows="4"/>
</el-form-item>
</el-form>
<div class="drawer-bootom-button" v-show="!disableSubmit">
<a-button style="margin-right: 0.8rem" @click="handleReset('addPersonFromRules')">重置</a-button>//方法中进行表单的ref参数传递
<a-button @click="addPersontNode1()" type="primary">保存</a-button>
</div>
</a-modal>
2.method
//重置
handleReset(formName) {
this.$refs[formName].resetFields();
}
,