From 1cf3431a050f0430fc2b9147255cc1fe01f687d8 Mon Sep 17 00:00:00 2001 From: Cat1007 <54425790+Cat1007@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:27:30 +0800 Subject: [PATCH] fix(DatePicker): fix preset invalid when needConfirm is false (#4792) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 增加标识识别preset引起的浮层关闭场景 * refactor: 🔨 优化 preset 场景的实现 * fix: 🐛 移除错误的代码 --- src/date-picker/DatePicker.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/date-picker/DatePicker.tsx b/src/date-picker/DatePicker.tsx index 04efff8b5c..fe2b11af5f 100644 --- a/src/date-picker/DatePicker.tsx +++ b/src/date-picker/DatePicker.tsx @@ -240,7 +240,10 @@ export default defineComponent({ trigger: 'preset', }, ); - + // 更新到 input,避免 needConfirm 导致值被覆盖 + inputValue.value = formatDate(presetVal, { + format: formatRef.value.format, + }); popupVisible.value = false; }