This commit is contained in:
2019-12-14 09:20:48 +08:00
parent 57e95e3217
commit 933673b092
372 changed files with 8090 additions and 0 deletions

1
utils/dist/checkbox-group/index.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export {};

39
utils/dist/checkbox-group/index.js vendored Normal file
View File

@@ -0,0 +1,39 @@
import { VantComponent } from '../common/component';
VantComponent({
field: true,
relation: {
name: 'checkbox',
type: 'descendant',
linked(target) {
this.children = this.children || [];
this.children.push(target);
this.updateChild(target);
},
unlinked(target) {
this.children = this.children.filter((child) => child !== 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,
disabled: disabled || child.data.disabled
});
}
}
});

3
utils/dist/checkbox-group/index.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"component": true
}

1
utils/dist/checkbox-group/index.wxml vendored Normal file
View File

@@ -0,0 +1 @@
<slot />

1
utils/dist/checkbox-group/index.wxss vendored Normal file
View File

@@ -0,0 +1 @@
@import '../common/index.wxss';