Commit 3ed2339a6d75abbd6ccf723b6eaa762f9921409e
1 parent
6edca1c1
fix(tree): support defaultExpandAll prop
defaultExpandLevel已去除-1的行为定义,由defaultExpandAll代替。
Showing
3 changed files
with
5 additions
and
5 deletions
src/components/Tree/src/Tree.vue
... | ... | @@ -211,12 +211,11 @@ |
211 | 211 | }); |
212 | 212 | |
213 | 213 | onMounted(() => { |
214 | - if (props.defaultExpandLevel === '') return; | |
215 | 214 | const level = parseInt(props.defaultExpandLevel); |
216 | - if (level === -1) { | |
217 | - expandAll(true); | |
218 | - } else if (level > 0) { | |
215 | + if (level > 0) { | |
219 | 216 | state.expandedKeys = filterByLevel(level); |
217 | + } else if (props.defaultExpandAll) { | |
218 | + expandAll(true); | |
220 | 219 | } |
221 | 220 | }); |
222 | 221 | ... | ... |
src/components/Tree/src/props.ts