leaflet 地图 html模板注册事件用法

88 阅读1分钟

在mounted内注册window事件

mounted() {
window.showNewCompanyDetail = this.showNewCompanyDetail
}

在对应的html内 这样生成的事件能触发

let html = `<div class="pop_bg"><div class="pop_title">${info.corporatename}</div>
      <div style="color:yellow;cursor:pointer;"onclick="window.showNewCompanyDetail('${info.relationUid}','')">查看详情 >></div></div></div>
      <div class="pop_content">`