Skip to content

Commit

Permalink
feat(empty): 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 fa678e3 commit acdc030
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/empty/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { emptyProps, default as NEmpty } from './src/Empty'
export type { EmptyProps } from './src/Empty'
export type { EmptyProps, EmptySlots } from './src/Empty'
8 changes: 8 additions & 0 deletions src/empty/src/Empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
defineComponent,
h,
type PropType,
type SlotsType,
type VNodeChild
} from 'vue'
import { NBaseIcon } from '../../_internal/icon'
Expand Down Expand Up @@ -35,9 +36,16 @@ export const emptyProps = {

export type EmptyProps = ExtractPublicPropTypes<typeof emptyProps>

export interface EmptySlots {
default?: any
extra?: any
icon?: any
}

export default defineComponent({
name: 'Empty',
props: emptyProps,
slots: Object as SlotsType<EmptySlots>,
setup(props) {
const { mergedClsPrefixRef, inlineThemeDisabled, mergedComponentPropsRef }
= useConfig(props)
Expand Down

0 comments on commit acdc030

Please sign in to comment.