From b09b168e2cd334f925e89a843986953880995359 Mon Sep 17 00:00:00 2001 From: Naily Date: Sat, 7 Dec 2024 22:15:01 +0800 Subject: [PATCH] feat(cascader): add slots type (#6599) --- src/cascader/index.ts | 2 +- src/cascader/src/Cascader.tsx | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cascader/index.ts b/src/cascader/index.ts index a849023bb9b..b2586a11eba 100644 --- a/src/cascader/index.ts +++ b/src/cascader/index.ts @@ -1,3 +1,3 @@ export { cascaderProps, default as NCascader } from './src/Cascader' -export type { CascaderProps } from './src/Cascader' +export type { CascaderProps, CascaderSlots } from './src/Cascader' export type { CascaderInst, CascaderOption } from './src/interface' diff --git a/src/cascader/src/Cascader.tsx b/src/cascader/src/Cascader.tsx index f027dde292b..b4138a989fc 100644 --- a/src/cascader/src/Cascader.tsx +++ b/src/cascader/src/Cascader.tsx @@ -36,6 +36,7 @@ import { type PropType, provide, ref, + type SlotsType, toRef, type VNode, type VNodeChild, @@ -193,9 +194,17 @@ export const cascaderProps = { export type CascaderProps = ExtractPublicPropTypes +export interface CascaderSlots { + action?: any + arrow?: any + empty?: any + 'not-found'?: any +} + export default defineComponent({ name: 'Cascader', props: cascaderProps, + slots: Object as SlotsType, setup(props, { slots }) { if (__DEV__) { watchEffect(() => {