This commit is contained in:
rickcole 2020-06-29 19:06:14 +08:00
parent c2e70e5430
commit 713a5bdb3f

View File

@ -170,15 +170,15 @@ function createScopedTools(
*/
close(target: string | boolean) {
const scoped = this;
let targets =
typeof target === 'string' ? target.split(/\s*,\s*/) : target;
// 过滤已经关掉的,当用户 close 配置多个弹框 name 时会出现这种情况
Array.isArray(targets) &&
targets
if (typeof target === 'string') {
// 过滤已经关掉的,当用户 close 配置多个弹框 name 时会出现这种情况
target
.split(/\s*,\s*/)
.map(name => scoped.getComponentByName(name))
.filter(component => component && component.props.show)
.forEach(closeDialog);
}
}
};
}