vue3中
import { ref, reset } from 'vue';
const appointmentForm = ref(/* 初始值 */);
function clearForm() { reset(appointmentForm); }
vue2中
//第一种
this.appointmentForm = this.$options.data.call(this).appointmentForm
// 用于重置数据第二种
let customerParam = () => ({
current: 1,
size: 10,
feelerMechanism: '', //检测机构
customerName: '', //客户名称(用检单位)
reportNumber: '', //检测报告编号
minValue1: '', //最小测试值1
maxValue1: '', // 最大检测值1
minValue2: '', // 最小测试值2
maxValue2: '', // 最大检测值2
detectionResult: '', //IN_INSPECT,PASS,NO_PASS,CANCEL,ALL
checkedItem1: '',
checkedItem2: ''
// children: [
// { label: '选项1', value: '10' },
// { label: '选项2', value: '20' }
// ],
})
// 分页参数
let param = reactive(customerParam())
// 重置
Object.assign(param, customerParam())