electron-vue+serialport+sqljs+iview

本文介绍了如何在系统环境中配置ELECTRON_MIRROR以使用淘宝镜像,然后通过vue init命令初始化一个基于electron-vue的项目mplat-client,探讨了集成serialport和sqljs进行桌面应用开发的基础步骤。
摘要由CSDN通过智能技术生成

一、相关设置
系统环境变量:ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/

二、初始化
1、vue init simulatedgreg/electron-vue mplat-client

原项目electron版本太低,进行升级
cd mplat-client
2、npm uninstall electron
3、npm install electron --save-dev
4、npm install serialport --save
5、npm install
6、src/main/index.js
	mainWindow = new BrowserWindow({
		height: 563,
		useContentSize: true,
		width: 1000,
		backgroundColor: "#ccc",
		webPreferences: {
			nodeIntegration: true, // to allow require
			contextIsolation: false, // allow use with Electron 12+
			webSecurity: false
		}
  })
7、npm uninstall vuex-electron
6、npm run dev
报错:Electron failed to install correctly, please delete node_modules/electron and try installing again
解决:cd node_modules/electron
	  node install.js
报错:http://localhost:9080/__webpack_hmr 404 (Not Found)
解决:.electron-vue/dev-runner.js第67、69行
	  hot: true, 添加注释:// hot: true,
	  app.use(ho
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值