我想制作一个这样的导航栏: https://stackblitz.com/edit/dynamic-nested-menus?file=app%2Fmenu-item%2Fmenu-item.component.html
但只有两个级别,有点像这样:
所以当我悬停或点击菜单时,子菜单会出现它们的子菜单
希望你能看懂,也能帮帮我,我找不到这样的东西。
答案 0 :(得分:0)
在您的 app.component.ts 中,您将找到导航项。
只需移除 childeren,您就不会获得菜单中的第三级。
navItems: NavItem[] = [
{
displayName: 'AngularMix',
iconName: 'close',
children: [
{
displayName: 'Speakers',
iconName: 'group',
children: [
{
displayName: 'Michael Prentice',
iconName: 'person',
route: 'michael-prentice',
children: [
{
displayName: 'Delight your Organization',
iconName: 'star_rate',
route: 'material-design'
}
]
},