Skip to content

Commit

Permalink
feat(cascader): add slots type (tusen-ai#6599)
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Dec 7, 2024
1 parent 14b2a52 commit b09b168
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cascader/index.ts
Original file line number Diff line number Diff line change
@@ -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'
9 changes: 9 additions & 0 deletions src/cascader/src/Cascader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
type PropType,
provide,
ref,
type SlotsType,
toRef,
type VNode,
type VNodeChild,
Expand Down Expand Up @@ -193,9 +194,17 @@ export const cascaderProps = {

export type CascaderProps = ExtractPublicPropTypes<typeof cascaderProps>

export interface CascaderSlots {
action?: any
arrow?: any
empty?: any
'not-found'?: any
}

export default defineComponent({
name: 'Cascader',
props: cascaderProps,
slots: Object as SlotsType<CascaderSlots>,
setup(props, { slots }) {
if (__DEV__) {
watchEffect(() => {
Expand Down

0 comments on commit b09b168

Please sign in to comment.