mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-03 03:38:41 +08:00
fix(components): [table-column, time-picker] improve typings (#4761)
This commit is contained in:
parent
70b754fe93
commit
fcd11d9bb0
@ -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>
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user