mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
perf: 优化窗口加载速度
This commit is contained in:
parent
928145214d
commit
1055daa0e3
4
electron/electron.js
vendored
4
electron/electron.js
vendored
@ -341,18 +341,16 @@ function createChildWindow(args) {
|
||||
browser = preloadWindow;
|
||||
preloadWindow = null;
|
||||
setTimeout(() => onShowWindow(browser), 300)
|
||||
browser.once('resize', () => onShowWindow(browser))
|
||||
browser.once('resize', () => setTimeout(() => onShowWindow(browser), 10))
|
||||
browser.setSize(options.width, options.height);
|
||||
browser.setMinimumSize(options.minWidth, options.minHeight);
|
||||
browser.center();
|
||||
browser.setParentWindow(options.parent);
|
||||
browser.setAutoHideMenuBar(options.autoHideMenuBar);
|
||||
browser.removeAllListeners("closed");
|
||||
console.log("use preload window")
|
||||
} else {
|
||||
// 创建新窗口
|
||||
browser = new BrowserWindow(options)
|
||||
console.log("create new window")
|
||||
}
|
||||
|
||||
browser.on('page-title-updated', (event, title) => {
|
||||
|
||||
@ -3373,9 +3373,6 @@ export default {
|
||||
width: Math.min(window.screen.availWidth, 1440),
|
||||
height: Math.min(window.screen.availHeight, 900),
|
||||
},
|
||||
webPreferences: {
|
||||
nodeIntegrationInSubFrames: msg.ext === 'drawio'
|
||||
},
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
this.$store.dispatch('openAppChildPage', {
|
||||
|
||||
@ -193,9 +193,6 @@ export default {
|
||||
width: Math.min(window.screen.availWidth, 1440),
|
||||
height: Math.min(window.screen.availHeight, 900),
|
||||
},
|
||||
webPreferences: {
|
||||
nodeIntegrationInSubFrames: this.file.type === 'drawio'
|
||||
},
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
this.$store.dispatch('openAppChildPage', {
|
||||
|
||||
@ -1706,9 +1706,6 @@ export default {
|
||||
width: Math.min(window.screen.availWidth, 1440),
|
||||
height: Math.min(window.screen.availHeight, 900),
|
||||
},
|
||||
webPreferences: {
|
||||
nodeIntegrationInSubFrames: file.ext === 'drawio'
|
||||
},
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
this.$store.dispatch('openAppChildPage', {
|
||||
|
||||
@ -1107,9 +1107,6 @@ export default {
|
||||
width: Math.min(window.screen.availWidth, 1440),
|
||||
height: Math.min(window.screen.availHeight, 900),
|
||||
},
|
||||
webPreferences: {
|
||||
nodeIntegrationInSubFrames: item.type === 'drawio'
|
||||
},
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
this.$store.dispatch('openAppChildPage', {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user