tree\nav支持svg icon

This commit is contained in:
qinhaoyan 2024-01-22 16:40:20 +08:00
parent a5dcdf7aac
commit c9096c19c3
3 changed files with 5 additions and 10 deletions

View File

@ -230,6 +230,9 @@
svg {
float: left;
}
svg {
top: 0;
}
}
&-item-icon {

View File

@ -1242,15 +1242,7 @@ export class TreeSelector extends React.Component<
: this.handleSelect(item))
}
>
{iconValue ? (
getIcon(iconValue) ? (
<Icon icon={iconValue} className="icon" />
) : React.isValidElement(iconValue) ? (
iconValue
) : (
<i className={iconValue}></i>
)
) : null}
{iconValue ? <Icon icon={iconValue} className="icon" /> : null}
</i>
) : null}

View File

@ -655,7 +655,7 @@ export class Navigation extends React.Component<
<Icon
key={`icon-${i}`}
cx={cx}
icon={item['icon']}
icon={item['icon'] || item}
className={isCollapsedNode ? '' : isAfter ? 'ml-2' : 'mr-2'}
/>
);