diff --git a/src/components/Tree/src/BasicTree.vue b/src/components/Tree/src/BasicTree.vue
index 680abc2c..2d23abfe 100644
--- a/src/components/Tree/src/BasicTree.vue
+++ b/src/components/Tree/src/BasicTree.vue
@@ -368,15 +368,21 @@ export default defineComponent({
: (
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)}
>
@@ -415,7 +421,9 @@ export default defineComponent({
)}
-
+
+ {extendSlots(slots, ['title'])}
+
diff --git a/src/components/Tree/src/TreeIcon.ts b/src/components/Tree/src/TreeIcon.ts
index ffc08cc9..bcfc3e04 100644
--- a/src/components/Tree/src/TreeIcon.ts
+++ b/src/components/Tree/src/TreeIcon.ts
@@ -4,7 +4,7 @@ import { h } from 'vue'
import { isString } from '@/utils/is'
import { Icon } from '@/components/Icon'
-export const TreeIcon: FunctionalComponent = ({ icon }: { icon: VNode | string }) => {
+export const TreeIcon: FunctionalComponent = ({ icon }: { icon: VNode | string | undefined }) => {
if (!icon)
return null
if (isString(icon))