vant-weapp使用

1.选中某个class类

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

转载于:https://www.cnblogs.com/supertan/p/11101600.html

你可能感兴趣的:(vant-weapp使用)