// 定义初始化的值
const initObj = {
name: null,
type: null,
};
// 定义reactive变量
const myForm = reactive({ ...initObj });
// 定义重置方法
const reset = () => {
Object.assign(myForm, initObj);
}
vue3重置reactive变量的值reactive变量整体赋值
最新推荐文章于 2024-12-17 09:42:44 发布