nrz 19773e2da4 [new feature] Checkbox: 新增 checkbox 组件 (#341)
* [new feature] Checkbox: init demo

* [new component]: Checkbox refactor

* [new component] Checkbox fix #231

* fix: #231
2018-07-09 21:37:17 +08:00

27 lines
515 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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});
});
}
}
});