ts文件中动态添加的html文件,如何绑定点击事件?
来源:

慕村2922186
2016-11-25
地图信息窗口创建时,需要传递一段html代码作为窗体的内容,在该窗口中我想用一个button接收点击事件,onclick和(click)都没用,请教老师怎么弄呀?
var infoWindow = new AMap.InfoWindow({
content: "<div style='font-size: 14px;'> " + (i + 1) + ". " + d.name +
"<button onclick='openLink()'" +
" style='color: #4ba5ea;font-size: 12px;'> 详情</button>" + "</div>"
+ this.createContent(d.type, d.address, d.tel),
autoMove: true,
offset: new AMap.Pixel(0, -30),
closeWhenClickMap: true
});
写回答
1回答
-
Parry
2016-11-25
openLink的定义写在哪里了?
00
相似问题
极光推送的启动在ts文件里怎么写?
回答 1
如何添加自定义scss文件
回答 1