简体   繁体   English

Angular 中的侧导航面板

[英]Side Nav panel in Angular

I am trying add a button (to open the side panel), but for some reason it shows up on the top left of the page.我正在尝试添加一个按钮(打开侧面板),但由于某种原因,它显示在页面的左上角。 I want it to appear on the middle (right side) so when the user clicks on it the panel displays.我希望它出现在中间(右侧),因此当用户单击它时,面板会显示。 I also want the current content on the page to zoom in when the side panel opens so the user is able to see both panel and the current content.我还希望在侧面板打开时放大页面上的当前内容,以便用户能够同时看到面板和当前内容。

descripition of what you want talk你想谈什么的描述

  <div>
    <button mat-button (click)="left.open()">Field Definitions</button>
  </div>

what is the correct CSS to?正确的 CSS 是什么?

I believe you're looking for this , it's an example provided in the Angular Material Documentation.我相信您正在寻找这个,这是 Angular 材料文档中提供的示例。

There are several ways to position the sidenav toggle button, you can either use CSS Flexbox or just add float: right property to the button. position sidenav 切换按钮有几种方法,您可以使用CSS Flexbox或添加float: right属性到按钮。 I would choose the first method combined with the use of mat-toolbar .我会选择第一种方法并结合使用mat-toolbar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM