方法一:
window.open("https://www.baidu.com");
即可打开弹窗
方法二:
js
//引入
const {BrowserWindow} = window.require('electron').remote;
//function
creatBrowser(){
var newWin = new BrowserWindow({
width:500,
height:500,
webPreferences: {
nodeIntegration: true,
},
})
newWin.loadFile('../demo.vue')
// 打开网址
// newWin.loadURL("https://www.baidu.com");
// window.open("https://www.baidu.com");
},
demo.vue自己随便写
这里路径要配置准确
若遇到此问题,问题指向node,一是版本,二是自己去研究
fs.existsSync is not a function
解决方法
const {BrowserWindow} = window.require('electron').remote;