Skip to content

Commit

Permalink
fix: infowindow卸载不关闭问题 #115
Browse files Browse the repository at this point in the history
  • Loading branch information
yue1123 authored Nov 25, 2024
2 parents 18b8118 + ffe1a70 commit a3f055d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/components/overlay/infowindow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
const { ready } = useParentComponentEffect((map: BMapGL.Map) => {
_map = map
const clear = () => {
infoWindow && map.removeOverlay(infoWindow)
if (!infoWindow) return
infoWindow.hide();
map.removeOverlay(infoWindow);
}
const init = () => {
const { title, width, height, enableAutoPan, maxWidth, offset, enableCloseOnClick } = props
Expand Down Expand Up @@ -103,7 +105,8 @@
nextTick(() => {
open()
nextTick(() => {
!infoWindow._visible && (visible.value = false)
if ('_visible' in infoWindow) !infoWindow._visible && (visible.value = false);
else !infoWindow.isOpen() && (visible.value = false);
})
})
}
Expand Down

0 comments on commit a3f055d

Please sign in to comment.