Giter Club home page Giter Club logo

jm-electron-template's Introduction

Electron 应用模板

Prerequisite

Install

git clone <this-project>
# 安装依赖
yarn

Usage

基本命令

# 开始开发服务器, 将使用webpack编译程序, 并运行electron
yarn start

# 构建生产环境代码
yarn build

# 打包electron程序
yarn package

技术栈

基本目录结构

  dist/        # 编译输出目录
  src/         # 源代码
    main/      # 主进程
      index.ts
    index.tsx  # index页面入口
    login.tsx  # login页面入口 
    page.json  # 页面配置

页面定义

renderer页面在src/page.json中定义, 例如:

{
  "index": {
    "width": 360,
    "minWidth": 360,
    "height": 780,
    "minHeight": 500,
    "frame": false,
    "minimizable": false,
    "maximizable": false,
    "alwaysOnTop": true,
    "skipTaskbar": true
  },
  "login": {},
  "webview": {}
}

根字段名表示页面名称, 属性值是窗口(BrowserWindow)的配置参数. 每一个页面必须在src目录下有一个对应的Javascript入口文件.

了解更多

本项目使用jm-cli进行代码构建. jm-cli是mygzb前端 项目的构建工具.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.