diff --git a/src/components/Tree/src/BasicTree.vue b/src/components/Tree/src/BasicTree.vue
index a9d3fad4..46373d2c 100644
--- a/src/components/Tree/src/BasicTree.vue
+++ b/src/components/Tree/src/BasicTree.vue
@@ -393,16 +393,26 @@
) : (
title
);
+
+ const iconDom = icon ? (
+
+ ) : slots.icon ? (
+ {getSlot(slots, 'icon')}
+ ) : null;
+
item[titleField] = (
{slots?.title ? (
- getSlot(slots, 'title', item)
+ <>
+ {iconDom}
+ {getSlot(slots, 'title', item)}
+ >
) : (
<>
- {icon && }
+ {iconDom}
{titleDom}
{renderAction(item)}
>
@@ -444,7 +454,9 @@
tip="加载中..."
>
-
+
+ {extendSlots(slots, ['title'])}
+
{
+export const TreeIcon = ({ icon }: { icon: VNode | string | undefined }) => {
if (!icon) return null;
if (isString(icon)) {
return h(Icon, { icon, class: 'mr-1' });