Skip to content

fix: Form getValue/setValue 使用 safeDeepClone 避免 File 等特殊对象克隆报错 - #2225

Merged
saint3347 merged 4 commits into
masterfrom
fix/form-safe-deep-clone
Aug 28, 2026
Merged

saint3347 merged 4 commits into
masterfrom
fix/form-safe-deep-clone

Conversation

@saint3347

Copy link
Copy Markdown
Contributor

变更内容

  • Form.tsgetValue() / setValue() 使用的 deepClone 替换为 safeDeepClone
  • safeDeepCloneFileBlob 等非普通对象保持引用,不进行深拷贝,避免克隆报错
  • 新增 safeDeepClone 工具函数单元测试
  • 新增 Form 含 File 值场景的集成测试

问题

当表单值中包含 File 对象时,deepClone 无法正确处理导致报错或数据丢失。

测试

  • test/utils/safeDeepClone.spec.js — 覆盖基础类型、对象、数组、File/Blob 等场景
  • test/src/Datum/Form.file.spec.js — 验证 Form setValue/getValue 处理含 File 的值

- 将 Form.ts 中的 deepClone 替换为 safeDeepClone
- safeDeepClone 对 File、Blob 等非普通对象保持引用而不做深拷贝
- 新增 safeDeepClone 工具函数的单元测试
- 新增 Form 含 File 值的集成测试
- 版本号升至 2.0.32-beta.10
@saint3347
saint3347 merged commit 2de3c11 into master Aug 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant