概率论原理精解【1】

阅读 10

2024-07-24

主进程 main

// main.js
const {app, Notification} = require("electron/main")

app.whenReady().then(() => {
	createWindow()
}).then(() => {
	new Notification({
		title: "Basis Notification",
		body: "Notification from main process"
	}).show()
})

渲染进程

// renderer.js
new window.Notification("Renderer Notification",{body: "Notification from renderer process"}).onclick = () => {
	console.log("Notification clicked")
}

精彩评论(0)

0 0 举报