From 45366cba8bee371014ed0312766f699977261046 Mon Sep 17 00:00:00 2001 From: Naily Date: Sun, 8 Dec 2024 00:21:23 +0800 Subject: [PATCH] feat(tree): export slots type (#6599) --- src/tree/index.ts | 2 +- src/tree/src/Tree.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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(() => {