mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
* [new feature] Checkbox: init demo * [new component]: Checkbox refactor * [new component] Checkbox fix #231 * fix: #231
27 lines
515 B
JavaScript
27 lines
515 B
JavaScript
const CHECKBOX_PATH = '../checkbox/index';
|
||
|
||
Component({
|
||
relations: {
|
||
[CHECKBOX_PATH]: {
|
||
type: 'child',
|
||
linked() {
|
||
this.updateChildren(CHECKBOX_PATH);
|
||
}
|
||
}
|
||
},
|
||
|
||
data: {
|
||
elementUpdateTimeout: 0
|
||
},
|
||
|
||
methods: {
|
||
updateChildren(childPath) { // 把checkbox标记为在group中,设置不同样式
|
||
let elements = this.getRelationNodes(childPath);
|
||
|
||
elements.forEach((checkbox, index) => {
|
||
checkbox.updateData({ isInGroup: true});
|
||
});
|
||
}
|
||
}
|
||
});
|