我正在使用Angular 4并且正在学习清晰度设计系统。 想知道是否有人设法用动态链接创建subnav? https://vmware.github.io/clarity/documentation/header#subnav
我不确定如何正确地解决这个问题。
答案 0 :(得分:2)
<nav class="subnav">
<ul class="nav">
<li class="nav-item" *ngFor="nav of navs">
<a class="nav-link" routerLinkActive="active"
[routerLink]="nav.link">{{nav.title}}</a>
</li>
</ul>
</nav>
在你班上:
nav = [
{link:'somewhere/dashboard',title:'Dashboard'},
{link:'somewhere/management',title:'Management'},
{link:'somewhere/cloud',title:'Cloud'}
]