1.下載electron
????????electron/electron-quick-start: Clone to try a simple Electron app (github.com)
? ? ? ? 下載實例模板
2.安裝依賴
? ? ? ? npm源改成中國鏡像
npm config set registry https://registry.npmmirror.com
? ? ? ? 然后用cnpm i 來安裝
? ? ? ? npm換官方源
npm config set registry https://registry.npmjs.org/
3.實例程序
const { app , BrowserWindow } = require('electron')app.whenReady().then(() => {const mainWindow = new BrowserWindow({width: 800,height: 600,})mainWindow.loadURL("https://www.bilibili.com/")
})
4.配置nodemon
"dev": "nodemon --exec electron ."