2019-09-30 15:29:46 +08:00

37 lines
782 B
JavaScript

import Page from '../../common/page';
Page({
data: {
checkbox1: true,
checkbox2: true,
checkbox3: true,
checkboxShape: true,
list: ['a', 'b', 'c'],
result: ['a', 'b'],
result2: [],
result3: [],
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png'
},
onChange(event) {
const { key } = event.currentTarget.dataset;
this.setData({ [key]: event.detail });
},
onClick(event) {
const { value } = event.currentTarget.dataset;
this.setData({
radio3: value
});
},
toggle(event) {
const { index } = event.currentTarget.dataset;
const checkbox = this.selectComponent(`.checkboxes-${index}`);
checkbox.toggle();
},
noop() {}
});