1.写一个事件:
<div @click="gobaidu" > lllllllll</div>
2.事件方法实现
gobaidu(){
const shell = require('electron').shell
shell.openExternal('http://www.baidu.com')
},
解释:electron有个shell方法,必须通过这个方法打开,如果在桌面端直接href,结果就是默认打开新的桌面端,而不是浏览器
1.写一个事件:
<div @click="gobaidu" > lllllllll</div>
2.事件方法实现
gobaidu(){
const shell = require('electron').shell
shell.openExternal('http://www.baidu.com')
},
解释:electron有个shell方法,必须通过这个方法打开,如果在桌面端直接href,结果就是默认打开新的桌面端,而不是浏览器