【发布时间】:2019-10-19 07:26:03
【问题描述】:
我使用带角度的传单,我想在标记上单击 addEventListener 以打开模态组件。但问题是,当我在下面运行我的代码时,addEventListener 会打开模态组件,而我没有点击标记。
let m = new L.Marker([33, 44], {
icon: new L.DivIcon({
className: 'my-div-icon',
html: `
<div>
<img src="${f[1].weather_status_icon_ar}"/style="width: 30px;height:
30px;">
</div>`
})
}).addEventListener('click',this.navigate(this.LocationID)).addTo(this.weather)
模态组件
async navigate(LocationID) {
const modal = await this.modalController.create({
component: WeatherDetailsPage,
});
await modal.present();
}
我想通过标记点击手动打开模态组件而不是自动
【问题讨论】: