Skip to content

Commit

Permalink
feat(card): 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 f1eb605 commit afcb2dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/card/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { cardProps, default as NCard } from './src/Card'
export type { CardProps, CardSegmented } from './src/Card'
export type { CardProps, CardSegmented, CardSlots } from './src/Card'
11 changes: 11 additions & 0 deletions src/card/src/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
defineComponent,
h,
type PropType,
type SlotsType,
type VNodeChild
} from 'vue'
import { NBaseClose } from '../../_internal'
Expand Down Expand Up @@ -71,9 +72,19 @@ export const cardProps = {

export type CardProps = ExtractPublicPropTypes<typeof cardProps>

export interface CardSlots {
default?: any
cover?: any
header?: any
'header-extra'?: any
footer?: any
action?: any
}

export default defineComponent({
name: 'Card',
props: cardProps,
slots: Object as SlotsType<CardSlots>,
setup(props) {
const handleCloseClick = (): void => {
const { onClose } = props
Expand Down

0 comments on commit afcb2dc

Please sign in to comment.