fix(preview): 首页图片预览 - 复用画布查看器 (#448)

This commit is contained in:
QAyong authored and GitHub committed 2026-09-09 06:48:09 +08:00
1 parent 249878fd49
commit e4acf5dfc9
6 files changed
+63 -92

No files matched your search

@@ -0,0 +1,27 @@
import { Image } from "antd";
type CanvasImagePreviewProps = {
src: string;
alt?: string;
onClose: () => void;
};
export function CanvasImagePreview({ src, alt = "图片", onClose }: CanvasImagePreviewProps) {
if (!src) return null;
return (
<Image
src={src}
alt={alt}
style={{ display: "none" }}
preview={{
open: true,
movable: true,
minScale: 0.5,
maxScale: 12,
scaleStep: 0.25,
onOpenChange: (open) => !open && onClose(),
}}
/>
);
}