Skip to content

Commit

Permalink
fix: tree custom icon not work
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Mar 17, 2020
1 parent 43c961c commit 1a61d1f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion antdv-demo
8 changes: 2 additions & 6 deletions components/tree/Tree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,9 @@ export default {
const { on = {}, slots = {}, scopedSlots = {}, class: cls, style, ...restProps } = item;
const treeNodeProps = {
...restProps,
icon:
($scopedSlots[scopedSlots.icon] && $scopedSlots[scopedSlots.icon](item)) ||
$slots[slots.icon] ||
restProps.icon,
icon: $scopedSlots[scopedSlots.icon] || $slots[slots.icon] || restProps.icon,
switcherIcon:
($scopedSlots[scopedSlots.switcherIcon] &&
$scopedSlots[scopedSlots.switcherIcon](item)) ||
$scopedSlots[scopedSlots.switcherIcon] ||
$slots[slots.switcherIcon] ||
restProps.switcherIcon,
title:
Expand Down
2 changes: 1 addition & 1 deletion components/vc-tree/src/TreeNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ const TreeNode = {
// Icon + Title
renderSelector(h) {
const { selected, loading, dragNodeHighlight } = this;
const icon = getComponentFromProp(this, 'icon');
const icon = getComponentFromProp(this, 'icon', {}, false);
const {
vcTree: { prefixCls, showIcon, icon: treeIcon, draggable, loadData },
} = this;
Expand Down

0 comments on commit 1a61d1f

Please sign in to comment.