This commit is contained in:
2023-12-30 22:44:36 +08:00
parent cf2ff28e58
commit b5dd4b6d7d
10 changed files with 267 additions and 136 deletions

View File

@@ -1,11 +1,11 @@
$.get('/api/menu', function (menuItems) {
var menuList = $('.layui-nav.layui-nav-tree');
menuList.empty();
var menuList = $('.layui-nav.layui-nav-tree');
menuList.empty();
menuItems.forEach(function (item) {
var href = item.path || 'javascript:void(0);'; // 提供一个默认值
menuList.append('<li class="layui-nav-item"><a href="' + href + '">' + item.name + '</a></li>');
});
menuItems.forEach(function (item) {
var href = item.path || 'javascript:void(0);'; // 提供一个默认值
menuList.append('<li class="layui-nav-item"><a href="' + href + '">' + item.name + '</a></li>');
});
layui.element.render('nav', 'test');
});
layui.element.render('nav', 'test');
});