mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-16 14:12: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;
|
browser = preloadWindow;
|
||||||
preloadWindow = null;
|
preloadWindow = null;
|
||||||
setTimeout(() => onShowWindow(browser), 300)
|
setTimeout(() => onShowWindow(browser), 300)
|
||||||
browser.once('resize', () => onShowWindow(browser))
|
browser.once('resize', () => setTimeout(() => onShowWindow(browser), 10))
|
||||||
browser.setSize(options.width, options.height);
|
browser.setSize(options.width, options.height);
|
||||||
browser.setMinimumSize(options.minWidth, options.minHeight);
|
browser.setMinimumSize(options.minWidth, options.minHeight);
|
||||||
browser.center();
|
browser.center();
|
||||||
browser.setParentWindow(options.parent);
|
browser.setParentWindow(options.parent);
|
||||||
browser.setAutoHideMenuBar(options.autoHideMenuBar);
|
browser.setAutoHideMenuBar(options.autoHideMenuBar);
|
||||||
browser.removeAllListeners("closed");
|
browser.removeAllListeners("closed");
|
||||||
console.log("use preload window")
|
|
||||||
} else {
|
} else {
|
||||||
// 创建新窗口
|
// 创建新窗口
|
||||||
browser = new BrowserWindow(options)
|
browser = new BrowserWindow(options)
|
||||||
console.log("create new window")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
browser.on('page-title-updated', (event, title) => {
|
browser.on('page-title-updated', (event, title) => {
|
||||||
|
|||||||
@ -3373,9 +3373,6 @@ export default {
|
|||||||
width: Math.min(window.screen.availWidth, 1440),
|
width: Math.min(window.screen.availWidth, 1440),
|
||||||
height: Math.min(window.screen.availHeight, 900),
|
height: Math.min(window.screen.availHeight, 900),
|
||||||
},
|
},
|
||||||
webPreferences: {
|
|
||||||
nodeIntegrationInSubFrames: msg.ext === 'drawio'
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
} else if (this.$isEEUiApp) {
|
} else if (this.$isEEUiApp) {
|
||||||
this.$store.dispatch('openAppChildPage', {
|
this.$store.dispatch('openAppChildPage', {
|
||||||
|
|||||||
@ -193,9 +193,6 @@ export default {
|
|||||||
width: Math.min(window.screen.availWidth, 1440),
|
width: Math.min(window.screen.availWidth, 1440),
|
||||||
height: Math.min(window.screen.availHeight, 900),
|
height: Math.min(window.screen.availHeight, 900),
|
||||||
},
|
},
|
||||||
webPreferences: {
|
|
||||||
nodeIntegrationInSubFrames: this.file.type === 'drawio'
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
} else if (this.$isEEUiApp) {
|
} else if (this.$isEEUiApp) {
|
||||||
this.$store.dispatch('openAppChildPage', {
|
this.$store.dispatch('openAppChildPage', {
|
||||||
|
|||||||
@ -1706,9 +1706,6 @@ export default {
|
|||||||
width: Math.min(window.screen.availWidth, 1440),
|
width: Math.min(window.screen.availWidth, 1440),
|
||||||
height: Math.min(window.screen.availHeight, 900),
|
height: Math.min(window.screen.availHeight, 900),
|
||||||
},
|
},
|
||||||
webPreferences: {
|
|
||||||
nodeIntegrationInSubFrames: file.ext === 'drawio'
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
} else if (this.$isEEUiApp) {
|
} else if (this.$isEEUiApp) {
|
||||||
this.$store.dispatch('openAppChildPage', {
|
this.$store.dispatch('openAppChildPage', {
|
||||||
|
|||||||
@ -1107,9 +1107,6 @@ export default {
|
|||||||
width: Math.min(window.screen.availWidth, 1440),
|
width: Math.min(window.screen.availWidth, 1440),
|
||||||
height: Math.min(window.screen.availHeight, 900),
|
height: Math.min(window.screen.availHeight, 900),
|
||||||
},
|
},
|
||||||
webPreferences: {
|
|
||||||
nodeIntegrationInSubFrames: item.type === 'drawio'
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
} else if (this.$isEEUiApp) {
|
} else if (this.$isEEUiApp) {
|
||||||
this.$store.dispatch('openAppChildPage', {
|
this.$store.dispatch('openAppChildPage', {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user