Merge branch '2.0' into anchor

This commit is contained in:
Lison 2018-06-20 11:00:05 +08:00 committed by GitHub
commit 754eedf571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
156 changed files with 61134 additions and 18815 deletions

View file

@ -233,12 +233,12 @@ export function findComponentsUpward (context, componentName) {
}
// Find brothers components
export function findBrothersComponents (context, componentName) {
export function findBrothersComponents (context, componentName, exceptMe = true) {
let res = context.$parent.$children.filter(item => {
return item.$options.name === componentName;
});
let index = res.indexOf(context);
res.splice(index, 1);
let index = res.findIndex(item => item._uid === context._uid);
if (exceptMe) res.splice(index, 1);
return res;
}