fix(components): [table-column, time-picker] improve typings (#4761)

This commit is contained in:
Carter Li 2021-12-10 18:14:31 +08:00 committed by GitHub
parent 70b754fe93
commit fcd11d9bb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ interface TableColumnCtx<T> {
column: TableColumnCtx<T>,
cellValue,
index: number
) => VNode
) => VNode | string
selectable: (row: T, index: number) => boolean
reserveSelection: boolean
filterMethod: FilterMethods<T>

View File

@ -211,7 +211,7 @@ const parser = function (
return day.isValid() ? day : undefined
}
const formatter = function (date: Date, format: string, lang: string) {
const formatter = function (date: number | Date, format: string, lang: string) {
return isEmpty(format) ? date : dayjs(date).locale(lang).format(format)
}

View File

@ -61,7 +61,7 @@ export const timePickerDefaultProps = {
default: () => ({}),
},
modelValue: {
type: [Date, Array, String] as PropType<string | Date | Date[]>,
type: [Date, Array, String] as PropType<string | Date | (number | Date)[]>,
default: '',
},
rangeSeparator: {