style: format code
parent
d3d787e2b0
commit
b154eeed28
|
@ -66,7 +66,7 @@ export default {
|
|||
// Expanded keys
|
||||
if (defaultExpandAll) {
|
||||
if (props.treeData) {
|
||||
state._expandedKeys = getFullKeyListByTreeData(props.treeData,props.replaceFields);
|
||||
state._expandedKeys = getFullKeyListByTreeData(props.treeData, props.replaceFields);
|
||||
} else {
|
||||
state._expandedKeys = getFullKeyList(children);
|
||||
}
|
||||
|
|
|
@ -88,14 +88,12 @@ export function convertDirectoryKeysToNodes(rootChildren, keys) {
|
|||
return nodes;
|
||||
}
|
||||
|
||||
export function getFullKeyListByTreeData(treeData,replaceFields) {
|
||||
export function getFullKeyListByTreeData(treeData, replaceFields = {}) {
|
||||
let keys = [];
|
||||
const {key='key',children='children'} = replaceFields
|
||||
|
||||
(treeData || []).forEach(item => {
|
||||
const { key = 'key', children = 'children' } = replaceFields(treeData || []).forEach(item => {
|
||||
keys.push(item[key]);
|
||||
if (item[children]) {
|
||||
keys = [...keys, ...getFullKeyListByTreeData(item[children],replaceFields)];
|
||||
keys = [...keys, ...getFullKeyListByTreeData(item[children], replaceFields)];
|
||||
}
|
||||
});
|
||||
return keys;
|
||||
|
|
Loading…
Reference in New Issue