Files
bdqh-course-platform-master/src/main/window/BaseWindow.ts

31 lines
708 B
TypeScript
Raw Normal View History

2023-10-13 16:39:27 +08:00
import { join } from 'path'
import { Menu, BrowserWindow } from 'electron'
Menu.setApplicationMenu(null)
// TODO: 修改标题栏ico图标
const BASE_WINDOW_OPTIONS = {
icon: join(__dirname, '../../../public/favicon.ico'),
webPreferences : {
nodeIntegration : true,
enableBlinkFeatures: 'Serial',
experimentalFeatures: true,
preload : join(__dirname, '../preload.js')
},
}
export abstract class BaseWindow extends BrowserWindow {
constructor (options = {}) {
Object.assign(options, BASE_WINDOW_OPTIONS)
super(options)
this.bindIpcEvent()
if (process.env.NODE_ENV === 'development') {
this.webContents.openDevTools()
}
}
bindIpcEvent() {}
}