vant-weapp使用

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使用

上一篇:Web Mapping Illustrated Using Open Source GIS Toolkits


下一篇:Unity琐碎(3) UGUI 图文混排解决方案和优化