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 ( <>