Skip to content

coderlindacheng/electron-demo

Repository files navigation

electron-demo

Clone and run for a quick way to see Electron in action.

This is a minimal Electron application based on the Quick Start Guide within the Electron documentation.

Use this app along with the Electron API Demos app for API code examples to help you get started.

A basic Electron application needs just these files:

  • package.json - Points to the app's main file and lists its details and dependencies.
  • main.js - Starts the app and creates a browser window to render HTML. This is the app's main process.
  • index.html - A web page to render. This is the app's renderer process.

You can learn more about each of these components within the Quick Start Guide.

To Use

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

cnpm install

如果还是被墙

Windows环境下:

C:\User~\AppData\Local\electron\Cache

C:\User~\AppData\Local\electron-builder\Cache

去下面的地址手动下载资源放到上面两个对应目录就完事了electron-builder-binaries

MAC环境下: 设置环境变量 ELECTRON_MIRROR="https://cdn.npm.taobao.org/dist/electron/" 才能打包成功

npm start -- 运行程序 npm run dev -- 研发模式运行程序 npm run dist -- 打包

注意

./src/render/html/index.html 不可以挪位置,且所有html都放在./src/render/html目录,因为主页面的位置是所有子页面的根目录,一动了,rootpath就变了

默认是打Windows得包,要打mac的包,就把package_mac.json覆盖package.json文件

这不是一个完全的版本,还有些功能没完成的

About

an electron demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published