refactor: 优化 layer.closeLast (#1652)

* refactor: 重构 layer.closeLast

feat: 不指定 type 时, 将从所有类型的层中寻找最近打开的
fix: 捕获层关闭顺序错误

* feat(layer): layer.closeLast 的 type 参数支持数组

* fix: hideOnClose 隐藏时不应收集索引
This commit is contained in:
morning-star
2024-02-28 08:46:16 +08:00
committed by GitHub
parent e8dde4cc7f
commit cecf33a83d
2 changed files with 13 additions and 2 deletions

View File

@@ -398,6 +398,7 @@ layer.closeLast('page'); // 关闭最近一次打开的页面层
layer.closeLast('iframe'); // 关闭最近一次打开的 iframe 层
layer.closeLast('loading'); // 关闭最近一次打开的加载层
layer.closeLast('tips'); // 关闭最近一次打开的 tips 层
layer.closeLast(['dialog', 'page']); // 关闭最近一次打开的信息框或页面层2.9.7+
```
<h2 id="config" lay-pid="api" class="ws-anchor ws-bold">全局配置默认属性</h2>