init项目

This commit is contained in:
2024-08-07 21:48:41 +08:00
parent 2c3a02d33b
commit 1581a5aaf5
18 changed files with 938 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
/*
* 如果启用了上下文隔离渲染进程无法使用electron的api
* 可通过contextBridge 导出api给渲染进程使用
*/
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electron', {
ipcRenderer: ipcRenderer,
})

14
electron/preload/index.js Normal file
View File

@@ -0,0 +1,14 @@
/*************************************************
** preload为预加载模块该文件将会在程序启动时加载 **
*************************************************/
const Addon = require('ee-core/addon');
/**
* 预加载模块入口
*/
module.exports = async () => {
// 示例功能模块,可选择性使用和修改
Addon.get('tray').create();
Addon.get('security').create();
}