角度材料 - 锁定左侧边栏并打开右侧边缘

时间:2018-04-02 06:08:17

标签: angular angular-material

我使用Angular 5和Angular Material。我的页面上有2个sidenavs,一个在左边,另一个在右边。我需要锁定打开左侧的侧面并有一个按钮来打开右侧的挡风玻璃。在AngularJS中可以实现这一点: https://material.angularjs.org/latest/demo/sidenav

我需要与Angular 5和Material具有相同的功能。 将不胜感激。

这是我的代码:

<mat-sidenav-container class="dashboard-mat-sidenav-container">

  <mat-sidenav-content>        
    <wab-header>
      <wab-search-button (click)="searchSideNav.open()"></wab-search-button>
    </wab-header>
      <wab-dashboard-quotes></wab-dashboard-quotes>

      <wab-left-nav-btn (click)="leftSideNav.open()"></wab-left-nav-btn>

      <div class="wb-menu-button" id="wb-button-search-mobile" (click)="searchSideNav.open()">        
        <div><i class="fas fa-search"></i></div>
      </div>

  </mat-sidenav-content>

  <mat-sidenav #leftSideNav position="start">
      <wab-left-nav>
      </wab-left-nav>
   </mat-sidenav>   

  <mat-sidenav #searchSideNav position="end">
     <wab-search-bar>
        <div (click)="searchSideNav.close()" id="search-box-close-btn"><i class="fas fa-window-close"></i></div>
     </wab-search-bar>
  </mat-sidenav> 

</mat-sidenav-container>

问题在于,如果我将左侧挡板锁定在打开状态,则右侧挡板根本不会打开。

0 个答案:

没有答案