style(Icon): delete default color

wip(router): async import route developing
This commit is contained in:
kailong321200875
2022-01-09 14:28:51 +08:00
parent c5ab3599c8
commit 95a2bd884d
11 changed files with 311 additions and 4 deletions

View File

@@ -34,3 +34,23 @@ export function underlineToHump(str: string): string {
return letter.toUpperCase()
})
}
/**
* 对象数组深拷贝
* @param {Array,Object} source 需要深拷贝的对象数组
* @param {Array} noClone 不需要深拷贝的属性集合
*/
export function deepClone(source: any, noClone: string[] = []): any {
if (!source && typeof source !== 'object') {
throw new Error('error arguments deepClone')
}
const targetObj: any = source.constructor === Array ? [] : {}
Object.keys(source).forEach((keys: string) => {
if (source[keys] && typeof source[keys] === 'object' && noClone.indexOf(keys) === -1) {
targetObj[keys] = deepClone(source[keys], noClone)
} else {
targetObj[keys] = source[keys]
}
})
return targetObj
}