<map>组件里使用<view>组件,在开发者工具里,view组件的点击事件无法触发,真机没问题。
发布于 5 年前 作者 xia28 14766 次浏览 来自 官方Issues

如题。

<map>

&lt;view catchtap="xxx"&gt;&lt;/view&gt;

</map>

在map组件里使用view组件时,view组件的点击事件在开发者中没办法触发,只能触发双击放大地图。很不方便开发。

3 回复
<map class="map" id="map" longitude="113.324520" latitude="23.099994" scale="14" bindcontroltap="controltap" bindmarkertap="markertap" bindregionchange="regionchange" show-location style="width: 100%; height: 80vh;">
  <view catchtap="showModal" class="test" style="width:100px;height:100px;background: red;">showModal</view>
</map>
<view catchtap="showModal">showModal</view>

js代码:

showModal () {
    wx.showModal({
      title: 'test',
      content: 'test',
    })
  }

我想知道你要做什么要在map加view

回到顶部