From 69dcf1add272679ea3025ac1754e5937e5b5d177 Mon Sep 17 00:00:00 2001 From: wjh Date: Thu, 25 Jul 2024 17:41:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=BE=E7=BD=AE=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=97=B6=E9=97=B4=E7=BB=84=E4=BB=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E7=94=9F=E6=95=88=20(#1388)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: sealday Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1388 Reviewed-by: sealday Co-authored-by: wjh Co-committed-by: wjh --- .../schema/components/antd-mobile/DatePicker/DatePicker.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/DatePicker/DatePicker.tsx b/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/DatePicker/DatePicker.tsx index 8015544af..f8a525225 100644 --- a/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/DatePicker/DatePicker.tsx +++ b/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/DatePicker/DatePicker.tsx @@ -7,7 +7,10 @@ import { Button, DatePicker, Input, Space } from 'antd-mobile'; export const MDatePicker = connect( (props) => { const [visible, setVisible] = useState(false); - const nowDate = props.value || new Date(); + const nowDate = props?.value || new Date(); + if (!props?.value) { + props.onChange(nowDate); + } return ( <>