ELECTRON study three

Today, we make a snowflake falling

The first step: npm init

Step 2: Install electron

npm config set registry http://registry.npm.taobao.org/

cnpm install electron -g (note installation version)

"devDependencies": {
    "electron": "^6.1.4",
	 "electron-packager": "13.0.1"
  }

Step Three: New main.js

mainWindow = new BrowserWindow({
        title: 'hello Electron',
        width: 800,
        height: 500,
        frame: false,
        transparent: true
    });
 mainWindow.loadURL('file://' + __dirname + '/src//index.html');  

Step Four: New index.html

Snowflake reference works: http://www.jq22.com/code2752

Step Five: Run

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "electron .",
    "pack": "electron-packager . Electron_Snow --win --out ../Electron_Snow --arch=x64 --app-version=0.0.1 --electron-version=6.1.4"
  },

  

cnpm run start

 

 

 

Guess you like

Origin www.cnblogs.com/tylz/p/11811222.html