.sub-navbar {
background-color: #002b31;
height:57px;
font-size: 13px;
margin-top: 175px;
}
这是我的CSS文件,
这是我的HTML文件
<div class="container-fluid">
<div class="row">
<nav class="navbar navbar-default sub-navbar">
<div *ngFor="let nav of navMenu">
<ul class="nav navbar-nav ">
<div *ngIf="nav.link == currentLink">
<li *ngFor="let sub of nav.subMenu">
<a [routerLink]="[sub.link]">
{{sub.name}}
</a>
</li>
</div>
</ul>
</div>
</nav>
</div>
这是子菜单的样子,因为菜单没问题/照片
答案 0 :(得分:0)
我找到了解决方案:D - 周末
<div class="container-fluid ">
<div class="row">
<nav class="navbar navbar-default sub-navbar">
<div *ngFor="let nav of navMenu">
<ul class="nav navbar-nav " *ngIf="nav.link == currentLink">
<!--<div *ngIf="nav.link == currentLink" >-->
<li *ngFor="let sub of nav.subMenu">
<a [routerLink]="[sub.link]">
{{sub.name}}
</a>
</li>
<!--</div>-->
</ul>
</div>
</nav>
</div>
问题出现在带有ngIf
的标签中