vue3中使用leaflet的popup弹窗,然后点击每个弹窗再弹出a-modal
现在可以循环出了多个popup弹窗,但是这段代码一直没有作用
map_index.on('popupopen', function () {
document.getElementById('btn').onclick = function () {
alert('111')
}
})
循环popup弹窗的代码为
bxdbzArr.forEach((marker) => {
popupBx.value = L.popup({closeButton: false, autoClose: false, closeOnClick: false,})
.setLatLng([marker.latB, marker.lngA])
.setContent('<div id="btn">' + marker.title + '</div>') // 设置弹窗的内容为相关信息
.addTo(map_index) // 在地图上打开弹
})
请教各位这个应该怎么循环加map_index.on('popupopen' 这部分