const {
app,
BrowserWindow,
nativeImage
} = require("electron");
let mainWindow;
require("electron-reload")(__dirname, {
electron: require(`${__dirname}/node_modules/electron`),
});
function createWindow() {
const icon = nativeImage.createFromPath(`${app.getAppPath()}/build/icon.png`);
if (app.dock) {
app.dock.setIcon(icon);
}
mainwindow = new BrowserWindow({
icon,
width: 800,
height: 600,
resizable: false,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false
},
});
mainwindow.loadFile("views/index.html");
}
app.whenReady().then(createWindow);
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
});
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
我在electronjs中的应用
有人可以帮助我吗?我有这个疑问很久了。
请尽快
..................................... ...................................