Web Notifications
Notification 接口的 title 只读属性指示通知的标题。此属性通过 Notification.Notification 构造函数的 title 参数指定。
值
一个字符串。
示例
function spawnNotification(theBody, theIcon, theTitle) {
const options = {
body: theBody,
icon: theIcon,
};
const n = new Notification(theTitle, options);
console.log(n.title);
}
规范
浏览器兼容性
参见
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
