mirror of
https://github.com/kuaifan/dootask.git
synced 2026-06-24 08:12:36 +00:00
fix(micro-app): 浏览器独立窗口(popout)关闭应用时关闭窗口
assistShow watch 此前只为 Electron 子窗口发送 windowDestroy 销毁窗口, 浏览器以 window.open 打开的 popout 独立窗口(single/apps.vue)关闭应用后 只隐藏内容、窗口空挂不关。补全浏览器分支:windowType 为 popout 时调用 window.close()。主程序内嵌的 embed 窗口(默认值)不进入此分支,不受影响。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e17a520599
commit
cf6f6041b6
@ -161,9 +161,17 @@ export default {
|
||||
this.unmountAllMicroApp()
|
||||
},
|
||||
assistShow(show) {
|
||||
if (!show && $A.isSubElectron && !this.isRestarting) {
|
||||
// 如果是子 Electron 窗口,关闭窗口助理时销毁窗口(但是重启过程中不销毁)
|
||||
if (show || this.isRestarting) {
|
||||
// 仍有应用打开,或正在重启过程中,都不销毁窗口
|
||||
return
|
||||
}
|
||||
if ($A.isSubElectron) {
|
||||
// 如果是子 Electron 窗口,关闭窗口助理时销毁窗口
|
||||
$A.Electron.sendMessage('windowDestroy');
|
||||
} else if (this.windowType === 'popout') {
|
||||
// 浏览器独立窗口(window-type="popout",由 window.open 打开):关闭浏览器窗口
|
||||
// 注意:仅 popout 生效,主程序内嵌的 embed 窗口(默认值)不会进入此分支
|
||||
window.close();
|
||||
}
|
||||
},
|
||||
microApps: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user