diff --git a/app/static/js/menu.js b/app/static/js/menu.js new file mode 100644 index 0000000..3c1a58e --- /dev/null +++ b/app/static/js/menu.js @@ -0,0 +1,11 @@ +$.get('/api/menu', function (menuItems) { + var menuList = $('.layui-nav.layui-nav-tree'); + menuList.empty(); + + menuItems.forEach(function (item) { + var href = item.path || 'javascript:void(0);'; // 提供一个默认值 + menuList.append('