简单串口调试工具 Electron 版本

界面

功能都比较简单,串口和波特率写死在代码了。
在这里插入图片描述

构建项目可能会有node版本的问题,需要重构node依赖

npm install
npm install serialport 
npm install electron-rebuild --save-dev
.\node_modules\.bin\electron-rebuild.cmd
npm install electron-builder --dev

执行代码是在index.js ,所以 main.js 要开启Node Api的权限 nodeIntegration 要设置为true

function createWindow () {
  // Create the browser window.
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
      nodeIntegration: true
    }
  })
  ..............
 }

代码地址: https://github.com/linzl008/serialport-electron.git

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章