electron 创建窗口2
生活随笔
收集整理的這篇文章主要介紹了
electron 创建窗口2
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*** 窗口管理類,單例,負責創建所有窗口,保存窗口實例*/const path = require('path'); const os = require('os'); const EucWindow = require('./euc_window');/*** 窗口管理類,單例,負責創建所有窗口,保存窗口實例*/ class WindowManager {constructor() {this.main = null;this.about = null;this.setting = null;}/*** 主窗口* @returns {EucWindow}*/createMainWindow(){if(this.main) return this.main;// 主窗口樣式const mainStyle = {// width: 280,// height: 400,// resizable: false,// frame: os.platform() !== "win32",show: true};this.main = new EucWindow(mainStyle, path.join(__dirname, '../../index.html'), this.main);return this.main;}/*** 關于窗口* @returns {EucWindow}*/createAboutWindow() {if(this.about) return this.about;// 關于窗口樣式const style = {width: 288,height: 336,resizable: false,frame: os.platform() !== "win32",show: true,modal: true,parent: this.main};this.about = new EucWindow(style, path.join(__dirname, '../test.html'), this.about);return this.about;} }module.exports = WindowManager;
?
轉載于:https://www.cnblogs.com/sxz2008/p/6796701.html
總結
以上是生活随笔為你收集整理的electron 创建窗口2的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 做防水多少钱一平米啊?
- 下一篇: 【应用篇】Activiti外置表单实例d