初始化模板

This commit is contained in:
沫烬染
2023-07-04 01:03:19 +08:00
parent 64ec9374dd
commit e285c8b14b
4 changed files with 67 additions and 0 deletions

20
src/main.js Normal file
View File

@@ -0,0 +1,20 @@
// 运行在 Electron 主进程 下的插件入口
// 加载插件时触发
function onLoad(plugin, liteloader) {
}
// 创建窗口时触发
function onBrowserWindowCreated(window, plugin) {
}
// 这两个函数都是可选的
module.exports = {
onLoad,
onBrowserWindowCreated
}

8
src/preload.js Normal file
View File

@@ -0,0 +1,8 @@
// Electron 主进程 与 渲染进程 交互的桥梁
const { contextBridge } = require("electron");
// 在window对象下导出只读对象
contextBridge.exposeInMainWorld("plugin_template", {
});

20
src/renderer.js Normal file
View File

@@ -0,0 +1,20 @@
// 运行在 Electron 渲染进程 下的页面脚本
// 页面加载完成时触发
function onLoad() {
}
// 打开设置界面时触发
function onConfigView(view) {
}
// 这两个函数都是可选的
export {
onLoad,
onConfigView
}