diff --git a/src/tree/index.ts b/src/tree/index.ts index 7e03fada31d..e6ac0b2f7f7 100644 --- a/src/tree/index.ts +++ b/src/tree/index.ts @@ -7,5 +7,5 @@ export type { TreeOverrideNodeClickBehaviorReturn } from './src/interface' export { default as NTree, treeProps } from './src/Tree' -export type { TreeProps } from './src/Tree' +export type { TreeProps, TreeSlots } from './src/Tree' export { treeGetClickTarget } from './src/utils' diff --git a/src/tree/src/Tree.tsx b/src/tree/src/Tree.tsx index 9ece979404e..bd7e160b9e7 100644 --- a/src/tree/src/Tree.tsx +++ b/src/tree/src/Tree.tsx @@ -46,6 +46,7 @@ import { type PropType, provide, ref, + type SlotsType, toRef, type VNode, type VNodeChild, @@ -348,9 +349,15 @@ export const treeProps = { export type TreeProps = ExtractPublicPropTypes +export interface TreeSlots { + default?: any + empty?: any +} + export default defineComponent({ name: 'Tree', props: treeProps, + slots: Object as SlotsType, setup(props) { if (__DEV__) { watchEffect(() => {