diff --git a/packages/core/client/src/schema-component/antd/g2plot/G2Plot.tsx b/packages/core/client/src/schema-component/antd/g2plot/G2Plot.tsx index 7d31528bb..a64943111 100644 --- a/packages/core/client/src/schema-component/antd/g2plot/G2Plot.tsx +++ b/packages/core/client/src/schema-component/antd/g2plot/G2Plot.tsx @@ -62,12 +62,14 @@ export const G2Plot: any = observer((props: any) => { const { t } = useTranslation(); useEffect(() => { field.data = field.data || {}; - field.data.loaded = false; if (typeof config?.data?.then === 'function') { + field.data.loaded = false; config?.data?.then((data) => { field.componentProps.config.data = data; field.data.loaded = true; }); + } else { + field.data.loaded = true; } }, []); if (!plot || !config) {