当菜单有下级的时候无法sidebar

可利用菜单的扩展属性,增加data-href属性实现
pull/493/head
amplam 2025-04-25 10:55:37 +08:00
parent 038b09c4e5
commit 9d4a5e04f2
1 changed files with 8 additions and 5 deletions

View File

@ -22,8 +22,11 @@ define(['fast', 'template', 'moment'], function (Fast, Template, Moment) {
});
$.each(badgeList, function (k, v) {
var anchor = top.window.$("li a[addtabs][url='" + k + "']");
anchor=anchor??top.window.$("li a[addtabs][data-href='" + k + "']");
if (anchor) {
if (!anchor||anchor.html()===undefined){
k = k.replace(Config.moduleurl+'/', "");
anchor=top.window.$("li a[addtabs][data-href='" + k + "']");
}
if (anchor&&v) {
top.window.$(".pull-right-container", anchor).html(v);
top.window.$(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v);
}