diff --git a/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/ImageUploader/ImageUploader.tsx b/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/ImageUploader/ImageUploader.tsx index 7408da99a..4075de3a9 100644 --- a/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/ImageUploader/ImageUploader.tsx +++ b/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/components/antd-mobile/ImageUploader/ImageUploader.tsx @@ -7,6 +7,7 @@ import { ImageUploader, ImageUploadItem } from 'antd-mobile'; export const MImageUploader = connect( (props) => { const [fileList, setFileList] = useState([]); + const [change, setChange] = useState(false); const field = props.value || []; useEffect(() => { @@ -47,6 +48,11 @@ export const MImageUploader = connect( setChange(true); props.onChange(field); }} + onDelete={(file) => { + const fileIndex = field.findIndex((item) => item.id === file.key); + field.splice(fileIndex, 1); + props.onChange(field); + }} /> ); },