diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Menus.razor b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Menus.razor index 78f998a4..5bed5534 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Menus.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Menus.razor @@ -1,8 +1,8 @@ @page "/Admin/Menus" + IsTree="true" OnTreeExpand="OnTreeExpand" TreeNodeConverter="TreeNodeConverter" ModelEqualityComparer="ModelEqualityComparer" + ExtendButtonColumnWidth="200" CustomerSearchModel="SearchModel" OnQueryAsync="OnQueryAsync"> i.ParentId == parentId).Select((nav, index) => new TableTreeNode(nav) { HasChildren = navs.Any(i => i.ParentId == nav.Id), - IsExpand = false, - // 获得子项集合 - // IsExpand = navs.Any(i => i.ParentId == nav.Id) - // Items = BuildTreeNodes(navs.Where(i => i.ParentId == nav.Id), nav.Id) + IsExpand = navs.Any(i => i.ParentId == nav.Id), + Items = BuildTreeNodes(navs.Where(i => i.ParentId == nav.Id), nav.Id) })); return ret; } } + + private bool ModelEqualityComparer(Navigation x, Navigation y) => x.Id == y.Id; }