Add logical treatment to 'accordion'

This commit is contained in:
zhigang.li 2018-01-15 14:45:50 +08:00
parent 3e3fba0ec2
commit a163daa07a
4 changed files with 38 additions and 5 deletions

View file

@ -228,6 +228,16 @@ export function findComponentsUpward (context, componentName) {
}
}
// Find brothers components
export function findBrothersComponents (context, componentName) {
let res = context.$parent.$children.filter(item => {
return item.$options.name === componentName;
});
let index = res.indexOf(context);
res.splice(index, 1);
return res;
}
/* istanbul ignore next */
const trim = function(string) {
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');