Commit 98e8a720 by lijiabin

fix: 修复toRef引用失效问题

parent c2615073
export function useResetData<T>(initialValue: T) {
const state = ref(structuredClone(initialValue))
const reset = () => {
// state.value = structuredClone(initialValue)
// 优化 防止 出现类似toRef引用丢失问题
Object.assign(state.value, structuredClone(initialValue))
state.value = structuredClone(initialValue)
}
return [state, reset] as [Ref<T>, () => void]
const forReset = () => {
// for循环便利 重置 避免部分属性使用到toRef引用丢失问题
for (const key in initialValue) {
state.value[key] = initialValue[key]
}
}
return [state, reset, forReset] as [Ref<T>, () => void, () => void]
}
......@@ -248,10 +248,6 @@ const columns: ExportColumn<BackendShopItemDto>[] = [
return value === 0 ? '待发放' : value === 1 ? '已发放' : '已取消'
},
},
{
title: '发放人备注',
key: 'memo',
},
]
// 对话框
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment