nemo-shen cececba911
feat(Checkbox): add direction prop (#4265)
* feat(Checkbox): add direction prop

* docs(checkbox): update doc
2021-06-17 09:42:58 +08:00

40 lines
851 B
JavaScript

import Page from '../../common/page';
Page({
data: {
checkbox1: true,
checkbox2: true,
checkbox3: true,
checkboxLabel: true,
checkboxSize: true,
checkboxShape: true,
list: ['a', 'b', 'c'],
result: ['a', 'b'],
result2: [],
result3: [],
result4: [],
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() {},
});