fix: data loaded
This commit is contained in:
parent
1921b2be31
commit
8583af232d
@ -62,12 +62,14 @@ export const G2Plot: any = observer((props: any) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
field.data = field.data || {};
|
field.data = field.data || {};
|
||||||
field.data.loaded = false;
|
|
||||||
if (typeof config?.data?.then === 'function') {
|
if (typeof config?.data?.then === 'function') {
|
||||||
|
field.data.loaded = false;
|
||||||
config?.data?.then((data) => {
|
config?.data?.then((data) => {
|
||||||
field.componentProps.config.data = data;
|
field.componentProps.config.data = data;
|
||||||
field.data.loaded = true;
|
field.data.loaded = true;
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
field.data.loaded = true;
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
if (!plot || !config) {
|
if (!plot || !config) {
|
||||||
|
Loading…
Reference in New Issue
Block a user