update Vue
This commit is contained in:
parent
5ddf1bcf4f
commit
444907c4ca
5 changed files with 60 additions and 107 deletions
|
@ -220,9 +220,10 @@ export function findComponentsDownward (context, componentName) {
|
|||
// Find components upward
|
||||
export function findComponentsUpward (context, componentName) {
|
||||
let parents = [];
|
||||
if (context.$parent) {
|
||||
if (context.$parent.$options.name === componentName) parents.push(context.$parent);
|
||||
return parents.concat(findComponentsUpward(context.$parent, componentName));
|
||||
const parent = context.$parent;
|
||||
if (parent) {
|
||||
if (parent.$options.name === componentName) parents.push(parent);
|
||||
return parents.concat(findComponentsUpward(parent, componentName));
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue