Commit 15ea0d2f53b76643605ceba0edd4014c77fa5a40
1 parent
ba2c1a3b
fix(tree): node slot take no effect
修复BasicTree节点插槽不起作用的问题
Showing
2 changed files
with
3 additions
and
2 deletions
CHANGELOG.zh_CN.md
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | - **BasicModal** | 4 | - **BasicModal** |
5 | - 修复点击遮罩、按下`Esc`键都不能关闭`Modal`的问题 | 5 | - 修复点击遮罩、按下`Esc`键都不能关闭`Modal`的问题 |
6 | - 修复点击关闭按钮、最大化按钮旁边的空白区域也会导致`Modal`关闭的问题 | 6 | - 修复点击关闭按钮、最大化按钮旁边的空白区域也会导致`Modal`关闭的问题 |
7 | +- **BasicTree** 修复节点插槽不起作用的问题 | ||
7 | 8 | ||
8 | ## 2.7.2(2021-09-14) | 9 | ## 2.7.2(2021-09-14) |
9 | 10 |
src/components/Tree/src/Tree.vue
@@ -422,8 +422,8 @@ | @@ -422,8 +422,8 @@ | ||
422 | class={`${prefixCls}-title pl-2`} | 422 | class={`${prefixCls}-title pl-2`} |
423 | onClick={handleClickNode.bind(null, item[keyField], item[childrenField])} | 423 | onClick={handleClickNode.bind(null, item[keyField], item[childrenField])} |
424 | > | 424 | > |
425 | - {slots?.title ? ( | ||
426 | - getSlot(slots, 'title', item) | 425 | + {item.slots?.title ? ( |
426 | + getSlot(slots, item.slots?.title, item) | ||
427 | ) : ( | 427 | ) : ( |
428 | <> | 428 | <> |
429 | {icon && <TreeIcon icon={icon} />} | 429 | {icon && <TreeIcon icon={icon} />} |