我正在使用 Angular 2 和 Material 2 开发 sidenav,
在Open State中,如下所示,
但是在关闭状态下它隐藏了整个sidenav,相反我只想隐藏菜单文本而不是图标。
看我的代码,
<md-toolbar color="primary">
<button md-icon-button (click)="start.toggle()">
<md-icon>menu</md-icon>
</button>Test Project
<button md-icon-button (click)="logout()">
<md-icon>exit_to_app</md-icon>
</button>
</md-toolbar>
<md-sidenav-layout class="left-navigation">
<md-sidenav #start mode="side" opened="true">
<md-nav-list>
<a [routerLink]="view.link" md-list-item *ngFor="let view of views" (click)="sidenav.close()">
<md-icon md-list-icon>{{view.icon}}</md-icon>
<span md-line>{{view.name}}</span>
</a>
</md-nav-list>
</md-sidenav>
<div class="demo-sidenav-content">
<router-outlet></router-outlet>
</div>
</md-sidenav-layout>