Skip to content

Commit

Permalink
feat(thing): 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 968ac46 commit 30ffd0a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/thing/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as NThing, thingProps } from './src/Thing'
export type { ThingProps } from './src/Thing'
export type { ThingProps, ThingSlots } from './src/Thing'
14 changes: 13 additions & 1 deletion src/thing/src/Thing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
defineComponent,
Fragment,
h,
type PropType
type PropType,
type SlotsType
} from 'vue'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../_mixins'
import { thingLight } from '../styles'
Expand All @@ -28,9 +29,20 @@ export const thingProps = {

export type ThingProps = ExtractPublicPropTypes<typeof thingProps>

export interface ThingSlots {
action?: any
avatar?: any
default?: any
description?: any
footer?: any
'header-extra'?: any
header?: any
}

export default defineComponent({
name: 'Thing',
props: thingProps,
slots: Object as SlotsType<ThingSlots>,
setup(props, { slots }) {
const { mergedClsPrefixRef, inlineThemeDisabled, mergedRtlRef }
= useConfig(props)
Expand Down

0 comments on commit 30ffd0a

Please sign in to comment.