Files
2024-09-27 01:07:59 +08:00

31 lines
1.1 KiB
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 软件在window下会存在重复运行的问题
即双击打开软件在windows下会创建一个新的运行程序。
#### 解决方法
```js
// 创建程序锁,保证只能打开单个实例
if (isWin()) {
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
} else {
app.on('second-instance', (event, commandLine, workingDirectory) => {
if (mainWindow) {
if (!mainWindow.isVisible()) {
mainWindowShow()
}
mainWindow.focus()
}
})
}
}
```
### win.setPosition方法报错
##### 原因setPosition方法中的参数不支持浮点数只支持整数
### 远程升级相关问题
#### 1.远程升级只能在build后生效
#### 2.mac端远程升级需要development ID 到官网申请
#### 3.安装最新的electron-update后运行提示缺少`whenReady()`方法,那是因为`electron-vue`的`electron`版本为2.7的而`whenReady()`为electron3.0.0更新的。解决办法就是升级electron