定时器改为轮询检查

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",
attr: { type: "text/javascript" },
});
setTimeout(() => {
const timer = setInterval(() => {
if (window.BMap?.Map) {
setLoaded(true);
}, 1000);
clearInterval(timer);
}
}, 500);
};
if (window?.base?.loadDynamicResource) {
callback();