export function useResetData<T>(initialValue: T) {
  const state = ref(structuredClone(initialValue))
  const reset = () => {
    state.value = structuredClone(initialValue)
  }
  const forReset = () => {
    //  for循环便利 重置 避免部分属性使用到toRef引用丢失问题
    for (const key in initialValue) {
      state.value[key] = initialValue[key]
    }
  }

  return [state, reset, forReset] as [Ref<T>, () => void, () => void]
}
