【发布时间】:2020-07-26 01:58:05
【问题描述】:
我有一个问题,experimental electron notification API 没有提交“点击”事件,或者我只是错误地使用了它,但是我想清楚的是,这是在主进程中而不是在渲染器中运行的新通知系统进程:
我的代码:
notification = new Notification({title: "Message Received",body: "message body"}).show()
// The above works and a notification gets made
notification.on('click', (event, arg)=>{
console.log("clicked")
})
// The above gives an error about 'on' not being defined
尝试过的事情:
notification.once('click', (event, arg)=>{
console.log("clicked")
})
notification.onclick = () =>{
console.log("clicked")
}
【问题讨论】:
标签: javascript node.js electron