We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b174f8 commit 684a581Copy full SHA for 684a581
packages/core/src/util/compatible.ts
@@ -1,11 +1,10 @@
1
-import { cloneDeep } from 'lodash-es';
2
-
3
-// 需要进行兼容操作,提供的方法
4
+// import { cloneDeep } from 'lodash-es';
5
// vue中data会进行Observe, 深拷贝的原始数据对象。
6
export const formatData = (data) => {
7
try {
8
- return cloneDeep(data);
+ // WARNING: cloneDeep虽然也会将Observe对象转换为plain对象,但是不会像JSON.parse那样,会将undefined去掉。
+ // 会导致后面的pick因为存在pick覆盖默认值的情况。
+ return JSON.parse(JSON.stringify(data));
9
} catch {
10
return data;
11
}
0 commit comments