deepClone(o){
if(Array.isArray(o)){
let flag = []
o.forEach(item=>flag.push(item))
return flag
} else if(typeof o === 'object'){
let flag = {}
for(let i in o){
flag[i] = this.deepClone(o[i])
}
return flag
} else {
return o
}
},
deepClone源码
最新推荐文章于 2023-08-14 23:06:37 发布