修复 cl-select-date 组件在范围选择模式下首次渲染时内容未显示的问题

This commit is contained in:
icssoa
2025-09-25 21:20:03 +08:00
parent 3f988f2c31
commit bc76c6e591

View File

@@ -644,11 +644,10 @@ async function onChange(data: number[]) {
// 设置value // 设置value
function setValue(val: string) { function setValue(val: string) {
text.value = "";
// 如果值为空,使用当前时间 // 如果值为空,使用当前时间
if (isNull(val) || isEmpty(val)) { if (isNull(val) || isEmpty(val)) {
value.value = checkDate(dayUts().toArray()); value.value = checkDate(dayUts().toArray());
text.value = "";
} else { } else {
// 否则解析为数组 // 否则解析为数组
value.value = checkDate(dayUts(val).toArray()); value.value = checkDate(dayUts(val).toArray());
@@ -660,8 +659,10 @@ function setValue(val: string) {
function setValues(val: string[]) { function setValues(val: string[]) {
if (isEmpty(val)) { if (isEmpty(val)) {
values.value = ["", ""]; values.value = ["", ""];
text.value = "";
} else { } else {
values.value = val; values.value = val;
updateText();
} }
} }