mirror of
https://github.com/youzan/vant.git
synced 2026-04-26 01:01:51 +08:00
fix: change utils && mixins alias
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user