Skip to content

Commit

Permalink
feat(timeline): export 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 b18dc5e commit 105c873
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/timeline/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as NTimeline, timelineProps } from './src/Timeline'
export type { TimelineProps } from './src/Timeline'
export { default as NTimelineItem, timelineItemProps } from './src/TimelineItem'
export type { TimelineItemProps } from './src/TimelineItem'
export type { TimelineItemProps, TimelineItemSlots } from './src/TimelineItem'
11 changes: 10 additions & 1 deletion src/timeline/src/TimelineItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
defineComponent,
h,
inject,
type PropType
type PropType,
type SlotsType
} from 'vue'
import { useConfig, useThemeClass } from '../../_mixins'
import {
Expand Down Expand Up @@ -37,9 +38,17 @@ export const timelineItemProps = {

export type TimelineItemProps = ExtractPublicPropTypes<typeof timelineItemProps>

export interface TimelineItemSlots {
default?: any
icon?: any
footer?: any
header?: any
}

export default defineComponent({
name: 'TimelineItem',
props: timelineItemProps,
slots: Object as SlotsType<TimelineItemSlots>,
setup(props) {
const NTimeline = inject(timelineInjectionKey)
if (!NTimeline) {
Expand Down

0 comments on commit 105c873

Please sign in to comment.