Explorar el Código

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

YunaiV hace 1 año
padre
commit
dfe19ca710
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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) {