有消息提示时页面标题增加点符号提示

This commit is contained in:
GoEdgeLab
2023-08-25 16:08:55 +08:00
parent 53fdfd987f
commit 66ad8d7567

View File

@@ -60,6 +60,18 @@ Tea.context(function () {
.params({}) .params({})
.success(function (resp) { .success(function (resp) {
this.globalMessageBadge = resp.data.count this.globalMessageBadge = resp.data.count
// add dot to title
let dots = "••• "
if (typeof document.title == "string") {
if (resp.data.count > 0) {
if (!document.title.startsWith(dots)) {
document.title = dots + document.title
}
} else if (document.title.startsWith(dots)) {
document.title = document.title.substring(dots.length)
}
}
}) })
.done(function () { .done(function () {
let delay = 6000 let delay = 6000