[Enhancement] [time-select] [Component] [el-time-select] min-time 组件设置的最小时间 预期应该也是可选的吧 现在是不可选的 #16663
lecker0323
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Feature type:
Enhancement
Details
time-select
Description
el-time-select 中 这行代码 compareTime(current, minTime.value || '-1:-1') <= 0
会影响 minTime的使用,比如我设置minTime为13:00 预期13:00也是可选的 现在线上的组件是不可选的 所以这行代码 应该是 compareTime(current, minTime.value || '-1:-1') < 0 吧
Additional comments
const items = computed(() => {
const result: { value: string; disabled: boolean }[] = []
if (props.start && props.end && props.step) {
let current = start.value
let currentTime: string
while (current && end.value && compareTime(current, end.value) <= 0) {
currentTime = dayjs(current, 'HH:mm')
.locale(lang.value)
.format(props.format)
result.push({
value: currentTime,
disabled:
compareTime(current, minTime.value || '-1:-1') < 0 ||
compareTime(current, maxTime.value || '100:100') >= 0,
})
current = nextTime(current, step.value!)
}
}
return result
})
3 votes ·
Beta Was this translation helpful? Give feedback.
All reactions