From 6200b69a0aa66865bd94bc159ff823fc97013811 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 27 十二月 2024 15:29:57 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- zy-acs-flow/src/map/JsonShow.jsx | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/zy-acs-flow/src/map/JsonShow.jsx b/zy-acs-flow/src/map/JsonShow.jsx index 977fed5..fd70475 100644 --- a/zy-acs-flow/src/map/JsonShow.jsx +++ b/zy-acs-flow/src/map/JsonShow.jsx @@ -23,7 +23,13 @@ const theme = useTheme(); const themeMode = theme.palette.mode; - let json = parseJson(data); + const [json, setJson] = useState(null); + + useEffect(() => { + if (data) { + setJson(parseJson(data)); + } + }, [data]); return ( <Paper -- Gitblit v1.9.1