在page.json页面写好路由
"buttons": [{
{
"fontSrc": "/static/yticon.ttf",
"text": "\ue744",
"fontSize": "27",
"color": "#303133",
"background": "rgba(0,0,0,0)",
"redDot": true //红点
}
]
动态设置红点的显示与隐藏;index是按钮的下标
if(count == 0) {
//隐藏
// #ifdef APP-PLUS
const pages = getCurrentPages();
const page = pages[pages.length - 1];
const currentWebview = page.$getAppWebview();
currentWebview.hideTitleNViewButtonRedDot({
index:1
});
// #endif
}else{
//显示
// #ifdef APP-PLUS
const pages = getCurrentPages();
const page = pages[pages.length - 1];
const currentWebview = page.$getAppWebview();
currentWebview.showTitleNViewButtonRedDot({
index:1
});
// #endif
}