0
点赞
收藏
分享

微信扫一扫

封装公共窗口

---------- 封装公共窗口 -----------------

class AppWindow extends BrowserWindow {

 constructor(config,fileLocation){

   const baseConfig = {

     width: 800,

     height: 600,

     webPreferences: {

       nodeIntegration: true

     }

   }


   // const finalConfig = Object.assign(baseConfig,config)

   const finalConfig = {...baseConfig,...config}

   super(finalConfig)

   this.loadFile(fileLocation)

    // 优化弹出窗口

   this.once('ready-to-show',()=>{

     this.show()

   })

 }

}

const mainWindow = new AppWindow({},'./renderer/index.html')

举报

相关推荐

0 条评论