mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
智慧宿舍系统小程序
This commit is contained in:
31
wechat/miniprogram/node_modules/@vant/weapp/dist/checkbox-group/index.js
generated
vendored
Normal file
31
wechat/miniprogram/node_modules/@vant/weapp/dist/checkbox-group/index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import { useChildren } from '../common/relation';
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
field: true,
|
||||
relation: useChildren('checkbox', function (target) {
|
||||
this.updateChild(target);
|
||||
}),
|
||||
props: {
|
||||
max: Number,
|
||||
value: {
|
||||
type: Array,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateChildren() {
|
||||
this.children.forEach((child) => this.updateChild(child));
|
||||
},
|
||||
updateChild(child) {
|
||||
const { value, disabled } = this.data;
|
||||
child.setData({
|
||||
value: value.indexOf(child.data.name) !== -1,
|
||||
parentDisabled: disabled,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user