收藏
回答

在swiper中嵌套map,拖拽map时swiper也会跟着滑动?

在使用swiper中嵌套了map,但是遇到的问题就是,拖拽map会导致swiper跟着滑动,尝试阻止气泡也不行,希望能得到大家的帮助

<swiper-item class="nkm18n {{swiperIndex==0?' active':''}}" skip-hidden-item-layout="true">
<view class="layout model b1w6uy" @touchmove.stop.prevent @touchstart.stop.prevent @touchend.stop.prevent>
<map id="map" ref="map" style="transition: height .5s;position:relative;" :style="{height: map.height,width:map.width}" :latitude="location[0].latitude" :longitude="location[0].longitude" :markers="markers"
				:show-location='true' :scale='scale' @regionchange="regionChange" @callouttap='callouttap' @click="goMaps()">
</map>
</view>
</swiper-item>
回答关注问题邀请回答
收藏

2 个回答

  • 任性༄🍎
    任性༄🍎
    2023-01-30

    @touchmove.stop.prevent 加给map组件是否可行?

    如果不行或者导致map异常,试下 wxs 中写拖动事件,进行阻止事件冒泡

    2023-01-30
    有用
    回复
  • Jianbo
    Jianbo
    2023-01-29

    都是拖动操作,这两个组件有冲突。

    2023-01-29
    有用
    回复 3
    • 眼镜大大
      眼镜大大
      2023-01-29
      如果这样的话,那应该所有可以拖动的组件都会有这种问题吧,但是小程序腾讯出行服务里的就不会有这个问题,应该有解决方法吧
      2023-01-29
      回复
    • Jianbo
      Jianbo
      2023-01-29回复眼镜大大
      你把map的层级调高一些试试。
      2023-01-29
      回复
    • 眼镜大大
      眼镜大大
      2023-01-29回复Jianbo
      不行,999了
      2023-01-29
      回复
登录 后发表内容