This commit is contained in:
gaoshuaixing
2021-08-17 16:33:55 +08:00
parent 0c4c3ea13d
commit cea2bf35a5
6 changed files with 34 additions and 14 deletions

View File

@@ -20,12 +20,22 @@
7. 自动更新
8. 更多功能请看文档
## 默认UI
## 使用场景
1. 常规桌面软件
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/file.png)
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/xm-pic-config.png)
2. 游戏h5相关技术开发
3. 任意网站变桌面软件
- discuz-q论坛
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/dq-feed.png)
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/dq-user.png)
4. web项目
- demo使用vue编写经典三栏样式可自定义使用你自己的前端页面
![](./build/img/file.png)
![](./build/img/ipc.png)
## 开始使用
@@ -84,8 +94,6 @@
![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-config.png)
![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-history.png)
![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-detail.png)
2. 可联系我qq530353222展示你的项目。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -31,21 +31,21 @@ const config = {
}
},
windowsOption: {
width: 980,
height: 600,
minWidth: 800,
minHeight: 600,
width: 500,
height: 900,
// minWidth: 500,
// minHeight: 600,
webPreferences: {
//webSecurity: false,
contextIsolation: false, // 设置此项为false后才可在渲染进程中使用electron api
nodeIntegration: true,
preload: path.join(__dirname, '../preload.js')
},
//frame: false,
frame: true,
//titleBarStyle: 'hidden'
},
egg: {
title: 'electron-egg', // 进程的title属性标识,无需改动
title: 'electron-egg', // 进程的title属性标识(默认你的应用名称-英文)
env: 'prod',
port: 7068,
hostname: 'localhost',
@@ -71,7 +71,11 @@ const config = {
uploadToServer: false,
ignoreSystemCrashHandler: true,
compress: false
}
},
remoteUrl: {
enable: true,
url: 'https://discuz.chat/'
},
}
exports.get = function (flag = '', env = 'prod') {

View File

@@ -80,6 +80,14 @@ async function startServer (options) {
const protocol = 'http://'
let startRes = null
let url = null
const remoteConfig = electronConfig.get('remoteUrl');
if (remoteConfig.enable) {
url = remoteConfig.url
MAIN_WINDOW.loadURL(url)
return true
}
if (ENV === 'prod') {
url = protocol + options.hostname + ':' + options.port
} else {

View File

@@ -1,6 +1,6 @@
{
"name": "electron-egg",
"version": "1.12.0",
"version": "1.13.0",
"description": "A fast, desktop software development framework",
"main": "main.js",
"softName": "electron-egg",