Giter VIP home page Giter VIP logo

electron-antd's Introduction

Quick start

install

yarn
# or
npm install

start dev

npm run dev

Overview

  • webpack
  • electron
  • electron-builder
  • electron-log
  • react
  • react-router
  • redux
  • ant-design
  • remixicon
  • less
  • typescript
  • eslint
  • prettier

DevTools

Toggle DevTools:

  • OSX: Cmd Alt I or F12
  • Linux: Ctrl Shift I or F12
  • Windows: Ctrl Shift I or F12

Build package

Modify builder.config.ts to edit package info.

For a full list of options see: https://www.electron.build/configuration/configuration

Create a package for OSX, Windows and Linux

npm run build

Please check the release folder after the build is complete.

License

MIT

electron-antd's People

Contributors

imgbotapp avatar lanten avatar liudonghua123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electron-antd's Issues

点击about页面的作者链接无法触发点击事件

文件路径:app/src/views/about/about.tsx
关键位置:

<p className="fs-12 text-gray">
          Copyright © {new Date().getFullYear()}{" "}
          <a
            onClick={() => {
              shell.openExternal("https://github.com/lanten");
            }}
          >

操作系统:Ubuntu 20.04 LTS
Node版本:v14.16.1
Electron版本:12.0.2
问题:
点击作者的a元素照理说会打开github页面,然而点击完全没反应,鼠标也没有变成手型,就好像上面有什么透明浮层一样。
哪怕是试图输出console.log也没有然后结果,应该是onClick完全没有被触发。
刚打开这个项目,不清楚怎么回事,如果作者有空烦请看看。

引入serialport 后报如下错误

index.js?04e8:60 Uncaught (in promise) Error: No native build was found for platform=darwin arch=x64 runtime=electron abi=99 uv=1 libc=glibc node=16.9.1 electron=16.0.7 webpack=true
loaded from:

项目无法正常启动

大佬,我是萌新。准备学习这块知识。按照教程,运行起来报错了,看不出问题所在,希望大佬指定迷津
image

//////////////////////////////////////////华丽的分割线//////////////////////////////////////////////

Microsoft Windows [版本 10.0.17763.557]
(c) 2018 Microsoft Corporation。保留所有权利。

E:\project\electron-antd>npm run dev

[email protected] dev E:\project\electron-antd
babel-node build/dev-server.js

development E:\project\electron-antd\src
Build completed in 50.06s

dev-server at http://localhost:3310

┏ ---------------------------- [Electron]

┗ ----------------------------

┏ ---------------------------- [Electron]
Failed to fetch extension, trying 4 more times

┗ ----------------------------

┏ ---------------------------- [Electron]
Failed to fetch extension, trying 3 more times

┗ ----------------------------

┏ ---------------------------- [Electron]
Failed to fetch extension, trying 2 more times

┗ ----------------------------

┏ ---------------------------- [Electron]
[10760:0728/123730.167:ERROR:CONSOLE(24)] "Empty response arrived for script 'chrome-devtools://devtools/remote/serve_file/@6a934f3637c0f0444da3420607820010f7fe6d36/product_registry_impl/product_registry_impl_module.js'", source: chrome-devtools://devtools/bundled/shell.js (24)

┗ ----------------------------

┏ ---------------------------- [Electron]
[10760:0728/123730.191:ERROR:CONSOLE(108)] "Uncaught (in promise) Error: Could not instantiate: ProductRegistryImpl.Registry", source: chrome-devtools://devtools/bundled/shell.js (108)

┗ ----------------------------

┏ ---------------------------- [Electron]
Failed to fetch extension, trying 1 more times

┗ ----------------------------

┏ ---------------------------- [Electron]
Failed to fetch extension, trying 0 more times
Unable to install react-developer-tools:
[Error: net::ERR_CONNECTION_TIMED_OUT]

┗ ----------------------------

┏ ---------------------------- [Electron]
[10760:0728/123733.868:ERROR:CONSOLE(108)] "Uncaught (in promise) Error: Could not instantiate: ProductRegistryImpl.Registry", source: chrome-devtools://devtools/bundled/shell.js (108)

┗ ----------------------------

大佬,我在项目里面用了child_process来执行命令,发现打win包之后不起作用了,调试是可以的

我的项目地址:https://gitee.com/Armyoftheworld/electron-antd
运行之后,点击打开jar这个标签,然后项目根目录下有个classes-dex2jar.jar文件,可以选择这个文件,点击执行,发现没反应,看我的打印里面是报错了
qq 20190215181349

直接用npm start启动的话,没有这个错误,而且可以打开一个新窗口的。
请问您能帮我看看吗?

hello, 请问如何加入mysql

您好,最近想加入一个需求,通过electron + antd 来构建一个可以访问数据库的桌面端,目前引入了"mysql": "^2.17.0",但是,目前在electron中引入后net原生组件无法加载,请教一下如何应对,谢谢

dev 出错

Hi, 我npm i 之后 npm start 出错了。该如何解决?谢谢!

internal/child_process.js:294
  var err = this._handle.spawn(options);
                         ^

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:294:26)
    at exports.spawn (child_process.js:378:9)
    at BrowserSync.cb (/Users/mo/Desktop/electron-antd-master/scripts/serve.js:34:16)
    at /Users/mo/Desktop/electron-antd-master/node_modules/browser-sync/lib/browser-sync.js:278:12
    at /Users/mo/Desktop/electron-antd-master/node_modules/browser-sync/lib/utils.js:283:25
    at executeTask (/Users/mo/Desktop/electron-antd-master/node_modules/browser-sync/lib/browser-sync.js:170:13)
    at Object.initUserPlugins [as fn] (/Users/moxingxum/Desktop/electron-antd-master/node_modules/browser-sync/lib/async.js:317:9)
    at /Users/mo/Desktop/electron-antd-master/node_modules/browser-sync/lib/browser-sync.js:149:14
    at iterate (/Users/mo/Desktop/electron-antd-master/node_modules/browser-sync/lib/utils.js:276:13)

你这个模板很棒:)

请问一下你那个setting 的页面怎么创建好呢,样板里面没有调用的例子,哈哈,
谢谢了

应用进程重复创建

在主进程存在时重复执行后创建了多个进程。

预期应用主进程唯一,重复执行不创建新进程,唤起主窗口。

窗口的最大化最小化的事件没有被触发

文件路径:app/src/components/app-titlebar/app-titlebar.tsx
关键位置:

    this.currentWindow.on("maximize", this.onMaximize);
    this.currentWindow.on("unmaximize", this.onUnmaximize);

    ......

  onMaximize = (): void => {
    this.setState({ maximized: true });
  };

  onUnmaximize = (): void => {
    this.setState({ maximized: false });
  };

操作系统:Ubuntu 20.04 LTS
Node版本:v14.16.1
Electron版本:12.0.2
问题:
本来窗口最大化后最大化按钮应该也会因此事件变为取消最大化的按钮,但是因为事件没有触发所以最大化按钮最大化后没有变化。
临时不靠谱的修复方案:取消事件机制,每次点击后主动setState修改状态。

  onClick={() => {
            this.currentWindow.unmaximize();
            this.setState({ maximized: false });
          }}
 ......
  onClick={() => {
            this.currentWindow.maximize();
            this.setState({ maximized: true });
          }}

刚打开这个项目,不清楚怎么回事,如果作者有空烦请看看。
如果能事件触发那必然更优雅和靠谱,希望作者能找到事件机制失效的原因修复它。
实在不行再考虑我这种机制,也许也得加个最大化是否成功的检测再决定是否setState。

electron 升级到5.0.4 报错

electron 升级到5.0.4 报错, 提示

[13644:0620/154148.162:INFO:CONSOLE(32789)] "Uncaught ReferenceError: require is not defined", source: http://localhost:3310/js/app.js (32789)

请问怎么创建新窗口替代当前窗口

类似于登录页面,目前创建窗口都是打开新的窗口,或者跳转怎么才能自由控制侧边栏和顶栏显示和不显示,目前auto.routes.ts里面createConfig只有在第一次生效,后面跳转设置false依然显示

MAC 上面退出有一个Error,可以去掉不呢:)

[34091:0506/123632.656885:ERROR:gles2_cmd_decoder.cc(18903)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[34091:0506/123632.656961:ERROR:gles2_cmd_decoder.cc(18924)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[34091:0506/123632.656989:ERROR:gles2_cmd_decoder.cc(13814)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[34091:0506/123632.657016:ERROR:gles2_cmd_decoder.cc(18903)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[34091:0506/123632.657034:ERROR:gles2_cmd_decoder.cc(18924)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[34091:0506/123632.657050:ERROR:gles2_cmd_decoder.cc(13814)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[34091:0506/123632.657072:ERROR:gles2_cmd_decoder.cc(18903)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[34091:0506/123632.657092:ERROR:gles2_cmd_decoder.cc(18924)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[34091:0506/123632.657113:ERROR:gles2_cmd_decoder.cc(13814)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format

我google过,没有结果,哈哈,

又点强迫症,windows没有这个,在dev环境上面 prod没有测试,但是估计也看不到

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.