1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 21:29:31 +08:00

v1.0.0-beta 源码正式开源

This commit is contained in:
小莫唐尼
2022-12-06 15:08:29 +08:00
commit 636ae7b169
461 changed files with 116817 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// 使用时,node = this.$parent;
// 根据给定的父组件名,寻找它的上一级。
export default function getParentAls(name,node) {
let parent = node;
while (parent) {
// 父组件
if (parent.$options?.name !== name) {
// 如果组件的name不相等,继续上一级寻找
parent = parent.$parent;
} else {
return parent;
}
}
return undefined;
}