fix: tree custom icon not work

pull/1890/head
tanjinzhou 2020-03-17 18:11:01 +08:00
parent 43c961c971
commit 1a61d1fa32
3 changed files with 4 additions and 8 deletions

@ -1 +1 @@
Subproject commit a69e38301cd2c54ecf47678ed4d1aa147eef2d7e
Subproject commit 48d6f869a283826b5ec7bc9a75ea76142d43186c

View File

@ -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:

View File

@ -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;