Skip to content

Commit

Permalink
feat(result): 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 a0223dc commit 6fd2272
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/result/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as NResult, resultProps } from './src/Result'
export type { ResultProps } from './src/Result'
export type { ResultProps, ResultSlots } from './src/Result'
10 changes: 9 additions & 1 deletion src/result/src/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
type CSSProperties,
defineComponent,
h,
type PropType
type PropType,
type SlotsType
} from 'vue'
import { NBaseIcon } from '../../_internal'
import {
Expand Down Expand Up @@ -53,9 +54,16 @@ export const resultProps = {

export type ResultProps = ExtractPublicPropTypes<typeof resultProps>

export interface ResultSlots {
default?: any
footer?: any
icon?: any
}

export default defineComponent({
name: 'Result',
props: resultProps,
slots: Object as SlotsType<ResultSlots>,
setup(props) {
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props)
const themeRef = useTheme(
Expand Down

0 comments on commit 6fd2272

Please sign in to comment.