优化打印机
This commit is contained in:
@@ -48,7 +48,7 @@ app.whenReady().then(() => {
|
||||
|
||||
// 创建打印小票子窗口
|
||||
const printWin = new BrowserWindow({
|
||||
show: true,
|
||||
show: false,
|
||||
width: 464,
|
||||
height: 2206,
|
||||
webPreferences: {
|
||||
@@ -71,8 +71,10 @@ app.whenReady().then(() => {
|
||||
})
|
||||
|
||||
// 执行打印操作
|
||||
printWin.on('printStart', (event, arg) => {
|
||||
ipcMain.on('printStart', (event, arg) => {
|
||||
console.log(arg);
|
||||
const _parmas = JSON.parse(arg)
|
||||
console.log(_parmas)
|
||||
let name = _parmas.deviceName
|
||||
printWin.webContents.print({
|
||||
silent: true,
|
||||
|
||||
Reference in New Issue
Block a user