From b9f0b9faac9f2328ea67e0f70dfbb00195b3e432 Mon Sep 17 00:00:00 2001 From: Naily Date: Sun, 8 Dec 2024 00:23:20 +0800 Subject: [PATCH] feat(tree-select): export slots type (#6599) --- src/tree-select/index.ts | 2 +- src/tree-select/src/TreeSelect.tsx | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tree-select/index.ts b/src/tree-select/index.ts index 67db9c2247e..0c451b087f5 100644 --- a/src/tree-select/index.ts +++ b/src/tree-select/index.ts @@ -12,4 +12,4 @@ export type { TreeSelectRenderTag } from './src/interface' export { default as NTreeSelect, treeSelectProps } from './src/TreeSelect' -export type { TreeSelectProps } from './src/TreeSelect' +export type { TreeSelectProps, TreeSelectSlots } from './src/TreeSelect' diff --git a/src/tree-select/src/TreeSelect.tsx b/src/tree-select/src/TreeSelect.tsx index 533be8c89e5..17c2bb129ea 100644 --- a/src/tree-select/src/TreeSelect.tsx +++ b/src/tree-select/src/TreeSelect.tsx @@ -36,6 +36,7 @@ import { type PropType, provide, ref, + type SlotsType, toRef, Transition, type VNodeChild, @@ -181,9 +182,17 @@ export const treeSelectProps = { export type TreeSelectProps = ExtractPublicPropTypes +export interface TreeSelectSlots { + header?: any + action?: any + arrow?: any + empty?: any +} + export default defineComponent({ name: 'TreeSelect', props: treeSelectProps, + slots: Object as SlotsType, setup(props) { if (__DEV__) { watchEffect(() => {