소스 검색

【代码修复】cloneDeep 深拷贝对列表的处理错误

YunaiV 1 년 전
부모
커밋
dfe19ca710
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      sheep/helper/utils.js

+ 1 - 1
sheep/helper/utils.js

@@ -45,7 +45,7 @@ export function last(data) {
 }
 
 export function cloneDeep(obj) {
-  const d = isArray(obj) ? obj : {};
+  const d = isArray(obj) ? [...obj] : {};
 
   if (isObject(obj)) {
     for (const key in obj) {