如何在弹出窗口中的按钮上触发点击事件?

时间:2019-03-27 18:37:13

标签: vue.js leaflet

我在弹出窗口中有一个按钮,当我单击它时,我希望能够在vue组件中调用方法。我已经在使用vue传单,但是在这种情况下,我必须使用传单的本机弹出功能。

我尝试使用此L.DomEvent并使用popupopen事件,但是由于我有很多弹出窗口,因此onclick被调用了几次。

L.popup().setLatLng(bounds.getCenter()).setContent(this.getPopupDisplayContent()).openOn(map);
getPopupDisplayContent() {
  return (
   `<div><button type="button" id="add-button">Add</button></div>`
  );
}

0 个答案:

没有答案