chore(components): [date-picker] export instasnce type (#13618)

* chore(components): [date-picker] export instasnce type

* move DatePickerInstance to instance.ts
This commit is contained in:
dopamine
2023-07-29 11:20:17 +08:00
committed by GitHub
parent 55272b51c3
commit b0258f6c3e
3 changed files with 15 additions and 1 deletions

View File

@@ -13,3 +13,4 @@ export default _DatePicker
export const ElDatePicker = _DatePicker
export * from './src/constants'
export * from './src/props/date-picker'
export type { DatePickerInstance } from './src/instance'

View File

@@ -18,6 +18,7 @@ import { ROOT_PICKER_INJECTION_KEY } from './constants'
import { datePickerProps } from './props/date-picker'
import { getPanel } from './panel-utils'
import type { DatePickerExpose } from './instance'
dayjs.extend(localeData)
dayjs.extend(advancedFormat)
@@ -43,7 +44,7 @@ export default defineComponent({
})
const commonPicker = ref<InstanceType<typeof CommonPicker>>()
const refProps = {
const refProps: DatePickerExpose = {
focus: (focusStartInput = true) => {
commonPicker.value?.focus(focusStartInput)
},

View File

@@ -0,0 +1,12 @@
import type { ComponentPublicInstance } from 'vue'
import type { DatePickerProps } from './props/date-picker'
export type DatePickerExpose = {
focus: (focusStartInput: boolean) => void
handleOpen: () => void
handleClose: () => void
}
export type DatePickerInstance = ComponentPublicInstance<
DatePickerProps,
DatePickerExpose
>