Commit 80b47c84cd490388c6db659921f1103c443d7b9d

Authored by Vben
1 parent 83a34603

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

CHANGELOG.zh_CN.md
... ... @@ -4,6 +4,7 @@
4 4  
5 5 - 修复`Description`已知问题
6 6 - 修复`BasicForm`已知问题
  7 +- 修复`BasicTree`下 ActionItem 的 show 属性逻辑问题
7 8  
8 9 ## 2.0.2 (2021-03-04)
9 10  
... ...
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  
... ...