提交 80b47c84 作者: Vben

fix(tree): fix the logic problem of show attribute of ActionItem under BasicTree

上级 83a34603
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
- 修复`Description`已知问题 - 修复`Description`已知问题
- 修复`BasicForm`已知问题 - 修复`BasicForm`已知问题
- 修复`BasicTree`下 ActionItem 的 show 属性逻辑问题
## 2.0.2 (2021-03-04) ## 2.0.2 (2021-03-04)
......
...@@ -236,13 +236,14 @@ ...@@ -236,13 +236,14 @@
const { actionList } = props; const { actionList } = props;
if (!actionList || actionList.length === 0) return; if (!actionList || actionList.length === 0) return;
return actionList.map((item, index) => { return actionList.map((item, index) => {
let nodeShow = true;
if (isFunction(item.show)) { if (isFunction(item.show)) {
return item.show?.(node); nodeShow = item.show?.(node);
} else if (isBoolean(item.show)) {
nodeShow = item.show;
} }
if (isBoolean(item.show)) { if (!nodeShow) return null;
return item.show;
}
return ( return (
<span key={index} class={`${prefixCls}__action`}> <span key={index} class={`${prefixCls}__action`}>
...@@ -343,7 +344,6 @@ ...@@ -343,7 +344,6 @@
} }
&__content { &__content {
// display: inline-block;
overflow: hidden; overflow: hidden;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论