许宏杰 10 months ago
parent 1608e82020
commit 75974e0641

@ -57,13 +57,12 @@ export default {
},
addParentId(tree, parentPath) {
tree.forEach((node) => {
// node.parentPath = node.path + parentPath; // id
let merge = parentPath
? this.filterPath(parentPath) + this.filterPath(node.path)
: this.filterPath(node.path);
node.fullPath = merge;
if (node.children && node.children.length > 0) {
this.addParentId(node.children, node.fullPath); // id id
this.addParentId(node.children, node.fullPath);
}
});
return tree;

Loading…
Cancel
Save