Skip to content

Commit

Permalink
feat(statistic): 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 318ec6f commit f4220cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/statistic/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as NStatistic, statisticProps } from './src/Statistic'
export type { StatisticProps } from './src/Statistic'
export type { StatisticProps, StatisticSlots } from './src/Statistic'
10 changes: 9 additions & 1 deletion src/statistic/src/Statistic.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ThemeProps } from '../../_mixins'
import type { ExtractPublicPropTypes } from '../../_utils'
import type { StatisticTheme } from '../styles'
import { computed, defineComponent, h } from 'vue'
import { computed, defineComponent, h, type SlotsType } from 'vue'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../_mixins'
import { resolveWrappedSlot } from '../../_utils'
import { statisticLight } from '../styles'
Expand All @@ -16,9 +16,17 @@ export const statisticProps = {

export type StatisticProps = ExtractPublicPropTypes<typeof statisticProps>

export interface StatisticSlots {
default?: any
label?: any
prefix?: any
suffix?: any
}

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

0 comments on commit f4220cf

Please sign in to comment.