From 80b47c84cd490388c6db659921f1103c443d7b9d Mon Sep 17 00:00:00 2001 From: Vben Date: Thu, 4 Mar 2021 23:17:04 +0800 Subject: [PATCH] fix(tree): fix the logic problem of show attribute of ActionItem under BasicTree --- CHANGELOG.zh_CN.md | 1 + src/components/Tree/src/index.vue | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index daf42d91007..65c70e85fc3 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -4,6 +4,7 @@ - 修复`Description`已知问题 - 修复`BasicForm`已知问题 +- 修复`BasicTree`下 ActionItem 的 show 属性逻辑问题 ## 2.0.2 (2021-03-04) diff --git a/src/components/Tree/src/index.vue b/src/components/Tree/src/index.vue index 58c5f331dc3..c4714f53825 100644 --- a/src/components/Tree/src/index.vue +++ b/src/components/Tree/src/index.vue @@ -236,13 +236,14 @@ const { actionList } = props; if (!actionList || actionList.length === 0) return; return actionList.map((item, index) => { + let nodeShow = true; if (isFunction(item.show)) { - return item.show?.(node); + nodeShow = item.show?.(node); + } else if (isBoolean(item.show)) { + nodeShow = item.show; } - if (isBoolean(item.show)) { - return item.show; - } + if (!nodeShow) return null; return ( @@ -343,7 +344,6 @@ } &__content { - // display: inline-block; overflow: hidden; }