From 80b47c84cd490388c6db659921f1103c443d7b9d Mon Sep 17 00:00:00 2001 From: Vben <anncwb@126.com> Date: 星期四, 04 三月 2021 23:17:04 +0800 Subject: [PATCH] fix(tree): fix the logic problem of show attribute of ActionItem under BasicTree --- src/components/Tree/src/index.vue | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Tree/src/index.vue b/src/components/Tree/src/index.vue index 58c5f33..c4714f5 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 ( <span key={index} class={`${prefixCls}__action`}> @@ -343,7 +344,6 @@ } &__content { - // display: inline-block; overflow: hidden; } -- Gitblit v1.8.0