首页 > 移动平台 > 详细

vant-weapp使用

时间:2019-06-28 11:35:58      阅读:236      评论:0      收藏:0      [点我收藏+]

1.选中某个class类

<van-checkbox-group value="{{ result }}" bind:change="onChange">
  <van-cell-group >
    <van-cell
      wx:for="{{ list }}"
      wx:key="index"
      title="复选框 {{ item }}"
      clickable
      data-name="{{ item }}"
      bind:click="toggle" >
      <van-checkbox catch:tap="noop" class="checkboxes-{{ item }}" name="{{ item }}" />
    </van-cell>
  </van-cell-group>
</van-checkbox-group>
使用selectComponent(‘class名称‘)选择
toggle(event) {
    const { name } = event.currentTarget.dataset;
    const checkbox = this.selectComponent(`.checkboxes-${name}`);
    checkbox.toggle();
  }
 

vant-weapp使用

原文:https://www.cnblogs.com/supertan/p/11101600.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!