fix(components): [el-date-picker] panel not select value enter error (#3768)

This commit is contained in:
btea 2021-10-05 02:46:17 -05:00 committed by GitHub
parent e5025ce50d
commit bf91f72351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,7 @@ import MonthTable from './basic-month-table.vue'
import YearTable from './basic-year-table.vue'
import type { PropType } from 'vue'
import type { Dayjs, ConfigType } from 'dayjs'
import type { ConfigType, Dayjs } from 'dayjs'
import type { IDatePickerType } from '../date-picker.type'
// todo
@ -512,9 +512,11 @@ export default defineComponent({
}
}
const isValidValue = (date_) => {
const isValidValue = (date: unknown) => {
return (
date_.isValid() && (disabledDate ? !disabledDate(date_.toDate()) : true)
dayjs.isDayjs(date) &&
date.isValid() &&
(disabledDate ? !disabledDate(date.toDate()) : true)
)
}