老师,我在这里为div绑定了事件,页面点击,没有反应
来源:8-9 Vue项目城市选择页 - Vuex实现数据共享
 
			Keily
2020-12-28
<div class="area">
        <div class="title border-bottom">热门城市</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>
        
handleCityClick: function (city) {
      alert(123 + ':' + city)
    }
写回答
	1回答
- 
				  Keily 提问者 2020-12-28 我后来搜索下了,提示我页面使用了better-scroll后,会阻断click事件,需要在创建better-scroll时,将click属性设置true mounted () { // this.scroll = new Bscroll(this.$refs.wrapper) this.$nextTick(() => { let bscrollDom = this.$refs.wrapper this.scroll = new Bscroll(bscrollDom, { mouseWheel: true, click: true, tap: true }) }) }1232022-04-10
相似问题