Skip to content

Commit

Permalink
Merge pull request #232 from zane0904/1.x
Browse files Browse the repository at this point in the history
fix:bug  #231 deep invalid
  • Loading branch information
leezng authored Feb 20, 2023
2 parents b0f4c34 + 4ec955a commit ff44366
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/Tree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ export default {
},
immediate: true,
},
deep: {
handler() {
this.hiddenPaths = jsonFlatten(this.data, this.rootPath).reduce((acc, item) => {
const depthComparison = item.level >= this.deep;
if ((item.type === 'objectStart' || item.type === 'arrayStart') && depthComparison) {
return {
...acc,
[item.path]: 1,
};
}
return acc;
}, {});
},
},
},
methods: {
updateVisibleData(flatDataValue) {
Expand Down

0 comments on commit ff44366

Please sign in to comment.