feat(#I13MQ4): 菜单更新后重新设置 active

This commit is contained in:
Argo Zhang 2019-11-02 16:34:58 +08:00
parent f8b826c65e
commit b9d7c37946
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 4 additions and 0 deletions

View File

@ -270,6 +270,8 @@ $(function () {
$nestMenu.nestMenu(initNestMenu);
function refreshSidebar() {
// 获取当前菜单
var id = $sidebar.find('.nav-link.active').parent().attr('id');
$.bc({
url: Menu.sidebar,
contentType: 'text/html',
@ -277,6 +279,8 @@ $(function () {
callback: function (result) {
if (result) {
$sidebar.html(result);
// reactive menu
$sidebar.find('.nav-item[id="' + id + '"] .nav-link').addClass('active');
}
}
});