定时器改为轮询检查

dev_1.2
tangjie 2026-07-30 11:49:28 +08:00
parent 3ef5e8c6a8
commit 33ef8a2dec
1 changed files with 6 additions and 3 deletions

View File

@ -32,9 +32,12 @@ const BaiduMapPicker = ({ visible, onCancel, onConfirm }) => {
type: "script", type: "script",
attr: { type: "text/javascript" }, attr: { type: "text/javascript" },
}); });
setTimeout(() => { const timer = setInterval(() => {
setLoaded(true); if (window.BMap?.Map) {
}, 1000); setLoaded(true);
clearInterval(timer);
}
}, 500);
}; };
if (window?.base?.loadDynamicResource) { if (window?.base?.loadDynamicResource) {
callback(); callback();