vue3 遍历form表单时,如何让填写的内容一样?
const formState = reactive({
studentId: undefined,
coachId: undefined,
contractId: undefined,
startDate: '',
startTime: '',
endDate: '',
endTime: '',
memo: '',
});
const formList = ref([formState]);
添加form
const addForm = () => {
formList.value.push(formState);
};
求大佬们指导?
使用
JSON.parse(JSON.stringify())
进行深拷贝即可