From e86ef25e6ded5eed6511e88473c051e24473e8e8 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Fri, 27 Dec 2024 13:37:57 +0800 Subject: [PATCH] 1 --- frontend/src/pages/Deploy/Deployment/List/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Deploy/Deployment/List/index.tsx b/frontend/src/pages/Deploy/Deployment/List/index.tsx index 953026e4..d8ab8203 100644 --- a/frontend/src/pages/Deploy/Deployment/List/index.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/index.tsx @@ -21,6 +21,11 @@ const CodePreviewModal: React.FC<{ }> = ({open, onCancel, code, language = 'shell'}) => { const [isFullscreen, setIsFullscreen] = useState(false); + // 当模态框打开或关闭时重置全屏状态 + useEffect(() => { + setIsFullscreen(false); + }, [open]); + return ( } open={open} - onCancel={onCancel} + onCancel={() => { + onCancel(); + setIsFullscreen(false); + }} footer={null} width={isFullscreen ? "100%" : 800} styles={{