1:右上角menu菜單, logout之后,login進(jìn)來,會多次調(diào)用menu點(diǎn)擊事件,
解決辦法:根據(jù)下方朋友的方法測試之后,有效!

image.png
2:在 NbMenuComponent 組件上面添加badge
在github上面找到了這個問題:https://github.com/akveo/nebular/issues/467
得知,目前NbMenuComponent這個控件上面沒有這個功能,后期應(yīng)該會添加到計(jì)劃中。
所以我只能用最笨的辦法,在頁面上找到dom,然后修改innerHTML
ngAfterViewInit() {
const temp_html = '疑問對賬單 <span style = "margin-left: 5px;display: inline-block;padding: .15em .4em;' +
'min-width: 8px;border-radius: 18px;background-color: #F43530;color: #FFFFFF;line-height: 1.2;' +
'text-align: center;font-size: 12px;vertical-align: middle;">new</span>';
this.el.nativeElement.querySelector('nb-menu').children[0]
.children[3].children[1].children[3]
.children[0].children[1].innerHTML = temp_html;
}
最終的菜單結(jié)果如下:

image.png
P.S. 我會一直更新下去,記錄使用ngx-admin出現(xiàn)的問題,其中一些解決辦法確實(shí)很粗魯,有好的方案希望大家留言!