收藏
回答

点击其中一个label,兄弟label事件也会触发?不是只会触发父节点或是子节点吗?怎么会冒泡到兄弟

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows 1.05.2204250

<view class="list"  >

        <label for="" capture-catch:touchstart="changclor"  mut-bind:touchend="colocolor"  style="background-color: {{bgcolor}};"> {{item}}</label>

        <label for="" capture-catch:touchstart="changclor"  mut-bind:touchend="colocolor"  style="background-color: {{bgcolor}};"> {{item}}</label>

</view>

data: {

    list:['1','2','3','4'],

    bgcolor:'',

  },

  changclor(){

    this.setData({

      bgcolor:'red'

    })

  },

  colocolor(){

    this.setData({

      bgcolor:''

    })

  },


回答关注问题邀请回答
收藏
登录 后发表内容