在给城市列表热门城市绑定点击事件时失效,后台提示违规??
来源:8-9 Vue项目城市选择页 - Vuex实现数据共享
viTaemin_nanali
2018-10-26
我跟着老师做的,不知道为啥后台提示swiper.js?067b:1363 [Violation] Added non-passive event listener to a scroll-blocking ‘touchmove’ event. Consider marking event handler as ‘passive’ to make the page more responsive
<div class="area">
<div class="title border-topbottom">热门城市</div>
<div class="button-list">
<div
class="button-wrapper"
v-for="item of hotCities"
:key="item.id"
@click="handleCityClick(item.name)"
>
<div class="button">{{item.name}}</div>
</div>
</div>
</div>
methods: {
handleCityClick (city) {
alert(city)
}
}
写回答
3回答
-
viTaemin_nanali
提问者
2018-10-26
解决了,向betetr-scroll添加option,this.scroll = new Bscroll(this.$refs.wrapper,{click:true})
30 -
浣玉
2018-12-25
多谢。
00 -
viTaemin_nanali
提问者
2018-10-26
测试了一遍,主要是安装了better-scroll的页面,如city-list,city-search的点击事件失效。
00
相似问题