Notification:dir 属性
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
备注: 此特性在 Web Worker 中可用。
Notification
接口的 dir
只读属性指示通知的文本方向,此文本方向在 Notification()
构造函数的 dir
选项中指定。
值
示例
以下代码段会触发通知;首先创建一个简单的 options
对象,然后使用 Notification()
构造函数触发通知。
js
const options = {
body: "你提交的代码收到了 3 条新的审阅意见。",
dir: "rtl",
};
const n = new Notification("新评论活动", options);
console.log(n.dir); // "rtl"
规范
Specification |
---|
Notifications API Standard # dom-notification-dir |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
dir |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.