主界面关闭时,使用window.open新开的子界面同时关闭
const openedWindows = ref([]);
const cardhub = (goto) => {
if (type === "open") {
openedWindows.value.push(window.open(goto));
window.open(`${goto}`)
}
}
const handleLogout = () => {
ElMessageBox.confirm('确定注销并退出系统吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
openedWindows.value.forEach(windowRef => {
if (windowRef && !windowRef?.closed) {
windowRef?.close();
}
});
openedWindows.value = []
}).catch(() => {
})
}