Skip to content

Commit

Permalink
feat(date-picker): 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 4cfb159 commit bbe901d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/date-picker/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as NDatePicker } from './src/DatePicker'
export type { DatePickerSlots } from './src/DatePicker'
export { datePickerProps } from './src/props'
export type * from './src/public-types'
12 changes: 12 additions & 0 deletions src/date-picker/src/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
provide,
type Ref,
ref,
type SlotsType,
toRef,
Transition,
type VNode,
Expand Down Expand Up @@ -68,9 +69,20 @@ import {

export type DatePickerSetupProps = ExtractPropTypes<typeof datePickerProps>

export interface DatePickerSlots {
'date-icon'?: any
footer?: any
'next-month'?: any
'next-year'?: any
'prev-month'?: any
'prev-year'?: any
separator?: any
}

export default defineComponent({
name: 'DatePicker',
props: datePickerProps,
slots: Object as SlotsType<DatePickerSlots>,
setup(props, { slots }) {
if (__DEV__) {
watchEffect(() => {
Expand Down

0 comments on commit bbe901d

Please sign in to comment.