feat: 初始化项目
This commit is contained in:
11
preload/index.js
Normal file
11
preload/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
|
||||
const handleSend = async (vue_params) => {
|
||||
let fallback = await ipcRenderer.invoke("sent-event", vue_params);
|
||||
return fallback;
|
||||
};
|
||||
|
||||
contextBridge.exposeInMainWorld("myApi", {
|
||||
handleSend: handleSend,
|
||||
// 能暴露的不仅仅是函数,我们还可以暴露变量
|
||||
});
|
||||
Reference in New Issue
Block a user