优化样式
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
"use strict";
|
||||
const path = require("path");
|
||||
const electron = require("electron");
|
||||
const { SerialPort } = require("serialport");
|
||||
SerialPort.list().then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
let win;
|
||||
electron.app.whenReady().then(() => {
|
||||
win = new electron.BrowserWindow({
|
||||
@@ -36,7 +32,6 @@ electron.app.whenReady().then(() => {
|
||||
});
|
||||
const printWin = new electron.BrowserWindow({
|
||||
show: false,
|
||||
width: 580,
|
||||
webPreferences: {
|
||||
// 集成网页和 Node.js,也就是在渲染进程中,可以调用 Node.js 方法
|
||||
nodeIntegration: true,
|
||||
@@ -51,6 +46,9 @@ electron.app.whenReady().then(() => {
|
||||
electron.ipcMain.on("printerInfoSync", (event, params) => {
|
||||
printWin.webContents.send("getParams", params);
|
||||
});
|
||||
electron.ipcMain.on("printStart", () => {
|
||||
console.log("开始打印");
|
||||
});
|
||||
});
|
||||
electron.app.on("window-all-closed", () => {
|
||||
if (process.platform !== "darwin")
|
||||
|
||||
Reference in New Issue
Block a user