📅  最后修改于: 2022-03-11 15:02:57.283000             🧑  作者: Mango
// this not working for me if i have nasted array of object in intialState not sure way
setup() {
const initialState = {
name: "",
lastName: "",
email: ""
};
const form = reactive({ ...initialState });
function resetForm() {
Object.assign(form, initialState);
}
function setForm() {
Object.assign(form, {
name: "John",
lastName: "Doe",
email: "john@doe.com"
});
}
return { form, setForm, resetForm };
}