style: format code
parent
d3d787e2b0
commit
b154eeed28
|
@ -88,11 +88,9 @@ export function convertDirectoryKeysToNodes(rootChildren, keys) {
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFullKeyListByTreeData(treeData,replaceFields) {
|
export function getFullKeyListByTreeData(treeData, replaceFields = {}) {
|
||||||
let keys = [];
|
let keys = [];
|
||||||
const {key='key',children='children'} = replaceFields
|
const { key = 'key', children = 'children' } = replaceFields(treeData || []).forEach(item => {
|
||||||
|
|
||||||
(treeData || []).forEach(item => {
|
|
||||||
keys.push(item[key]);
|
keys.push(item[key]);
|
||||||
if (item[children]) {
|
if (item[children]) {
|
||||||
keys = [...keys, ...getFullKeyListByTreeData(item[children], replaceFields)];
|
keys = [...keys, ...getFullKeyListByTreeData(item[children], replaceFields)];
|
||||||
|
|
Loading…
Reference in New Issue