Commit 80b47c84cd490388c6db659921f1103c443d7b9d
1 parent
83a34603
fix(tree): fix the logic problem of show attribute of ActionItem under BasicTree
Showing
2 changed files
with
6 additions
and
5 deletions
CHANGELOG.zh_CN.md
src/components/Tree/src/index.vue
... | ... | @@ -236,13 +236,14 @@ |
236 | 236 | const { actionList } = props; |
237 | 237 | if (!actionList || actionList.length === 0) return; |
238 | 238 | return actionList.map((item, index) => { |
239 | + let nodeShow = true; | |
239 | 240 | if (isFunction(item.show)) { |
240 | - return item.show?.(node); | |
241 | + nodeShow = item.show?.(node); | |
242 | + } else if (isBoolean(item.show)) { | |
243 | + nodeShow = item.show; | |
241 | 244 | } |
242 | 245 | |
243 | - if (isBoolean(item.show)) { | |
244 | - return item.show; | |
245 | - } | |
246 | + if (!nodeShow) return null; | |
246 | 247 | |
247 | 248 | return ( |
248 | 249 | <span key={index} class={`${prefixCls}__action`}> |
... | ... | @@ -343,7 +344,6 @@ |
343 | 344 | } |
344 | 345 | |
345 | 346 | &__content { |
346 | - // display: inline-block; | |
347 | 347 | overflow: hidden; |
348 | 348 | } |
349 | 349 | ... | ... |