使用Vue框架开发Electron项目[基于Vue CLI Plugin Electron Builder]

安装nodejs

官方网站下载新版本即可。

https://nodejs.org/

安装Vue CLI

我们使用npm安装,所以要先设定一个国内源

npm set registry https://registry.npm.taobao.org/

当然还可以使用淘宝的cnpm

npm install cnpm -g --registry=https://registry.npm.taobao.org 

安装Vue CLI

npm install -g @vue/cli

创建vue项目

vue create test

安装electron-builder

过程中需要选择Electron版本,选择最新版即可。

cd test
vue add electron-builder

启动程序

yarn electron:serve

原文地址:https://www.cnblogs.com/cnlihao/p/13254760.html