解决mand mobile中的md-swiper时,给轮播元素添加点击事件,安卓或微信浏览器没有反应。

问题描述:在使用md-swiper时,给图片添加点击事件,苹果手机可以点击跳转,但是安卓和微信浏览器没有反应。

问题解决方法:md-swiper里加一个 :is-prevent="false"

官方文档解释:is-prevent阻止默认的事件,如页面滚动事件,为swiper-item绑定点击事件需将其设置为false

1 <md-swiper  :is-prevent="false" >
2       <md-swiper-item :key="$index" v-for="(item, $index) in bannerList">
3            <img :src="item.imgUrl" @click="goDetail">
4        </md-swiper-item>
5  </md-swiper>

 

posted @ 2021-01-27 16:46  翻脸不如翻身  阅读(496)  评论(0编辑  收藏  举报