0

我们有一个基于 Electron 的应用程序,它支持 Windows、Linux 和 MacOS。

在某些 Windows 10 机器上,显示加载本地资源的新弹出窗口需要 4-6 秒。
通常显示弹出窗口的时间少于 200 毫秒。

2021-03-10 16:45:43.357 DEBUG  4480 [sta_electron:                             app.asar\background.js |    2:2464]: before load content
2021-03-10 16:45:46.915 DEBUG  4480 [sta_electron:                             app.asar\background.js |    2:2464]: after load content
    log.debug('before load content')

    if (process.env.WEBPACK_DEV_SERVER_URL) {
      // Load the url of the dev server if in development mode
      await win.loadURL(`${process.env.WEBPACK_DEV_SERVER_URL}DialogPopup`)
    } else {
      // Load the content page when not in development
      await win.loadURL('app://./DialogPopup.html')
    }

    log.debug('after load content')

"electron:serve": "vue-cli-service electron:serve",应用程序是在开发模式下启动还是作为打包的 EXE 文件启动也无关紧要。
在某些机器上它总是很慢,而在所有其他机器上它很快。
“慢”机器在客户网络内并具有网络代理配置,由于 Electron 应用程序不应请求外部资源,我看不出代理可能成为问题的原因。

我们将 electron-vue 与 Electron 12 和 Vue 3 一起使用。

DialogPopup.html 非常简单。它包含一个打包的 Vue 3 应用程序,没有外部资源。

对话框示例

有没有人已经看到这个问题或有什么想法?

4

0 回答 0