Electron+React历险记(1)
React+Electron+TS下引用ipcRenderer及node api
引入方式一(存在安全问题)
类型声明
//global.d.ts
declare global {
interface Window {
require: (module: 'electron') => {
ipcRenderer: IpcRenderer
};
}
}
main.ts引入
win = new BrowserWindow({
width: 980,
height: 735,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},
frame: false,
// resizable:false,
titleBarSty
共有 0 条评论