在index.html中引入的js不能用require方法,只能用src引入;然后在引入的这个js中也不能使用require方法?
来源:2-3 进程间通信
qq_慕圣3006777
2021-10-20
在index.html中引入的js不能用require方法,只能用src引入;然后在引入的这个js中也不能使用require方法?
写回答
1回答
-
Beep_beep
2021-11-03
const mainWindow = new BrowserWindow({
...
webPreferences:{
nodeIntegrantion: true,
contextIsolation:false
}
})
需要在 mainWindow webPreferences 中,添加 contextIsolation:false 这段代码
50
相似问题