checkbox component

This commit is contained in:
cookfront
2017-03-01 11:15:15 +08:00
parent 38d6771e72
commit e0be5b962e
14 changed files with 283 additions and 26 deletions
+22
View File
@@ -0,0 +1,22 @@
/**
* 根据父组件名找到对应`parent`
*/
export default {
methods: {
findParentByComponentName(name) {
if (this.parentGroup) return;
let parent = this.$parent;
while (parent) {
if (parent.$options.name === name) {
this.parentGroup = parent;
break;
} else {
parent = parent.$parent;
}
}
return this.parentGroup;
}
}
};