📝(layer): 修复 close 与 closeAll 案例
This commit is contained in:
parent
f3aaadee00
commit
4a52df1f28
@ -461,19 +461,20 @@ const openComponent2 = () => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { layer } from "../../../../layer/src/index"
|
import { layer } from "../../../../layer/src/index";
|
||||||
|
|
||||||
|
let id = null;
|
||||||
|
|
||||||
const open = function() {
|
const open = function() {
|
||||||
const id = layer.open({
|
id = layer.open({
|
||||||
title: "标题",
|
title: "标题",
|
||||||
content: "内容",
|
content: "内容",
|
||||||
shade: false
|
shade: false
|
||||||
})
|
})
|
||||||
return id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const close = function() {
|
const close = function() {
|
||||||
layer.close(open);
|
layer.close(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeAll = function() {
|
const closeAll = function() {
|
||||||
|
@ -31,7 +31,7 @@ const cleanInstance = () => {
|
|||||||
const isExist = (id: any) => {
|
const isExist = (id: any) => {
|
||||||
let b = false;
|
let b = false;
|
||||||
layerInstance.forEach((item: any, index: number) => {
|
layerInstance.forEach((item: any, index: number) => {
|
||||||
if (item.modalContainer.id === id) {
|
if (item.modalContainer.id == id) {
|
||||||
b = true;
|
b = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user