Angular 7 - 如何根据 window 大小处理两个不同的导航栏?
Angular 7 - How to deal with two different navbars based on window size?
我想我的问题很简单,
我正处于一个项目的开始,我刚刚完成了 Sidenav(位于屏幕左侧),我实际上将其用作一个组件。我想在 window 较小时使用 "normal" 顶部导航栏,但我不知道如何实际实现它。顶部导航栏是否需要另一个组件?如果是这样,我如何根据 window 大小在这两个之间切换?
顺便说下我用的是Materialize CSS...
我遇到了类似的问题。当我在 Angular 中创建简历时,我想在屏幕大于 700px 时显示 mat-horizontal-stepper
,在屏幕小于它时显示 mat-vertical-stepper
。所以我创建了一个 HostListener
到 window:resize
事件。
This is my deployed resume, if you resize you can see the expected behavior.
And this is my component's TS file, at line 36 you can find the HostListener
.
我想我的问题很简单,
我正处于一个项目的开始,我刚刚完成了 Sidenav(位于屏幕左侧),我实际上将其用作一个组件。我想在 window 较小时使用 "normal" 顶部导航栏,但我不知道如何实际实现它。顶部导航栏是否需要另一个组件?如果是这样,我如何根据 window 大小在这两个之间切换?
顺便说下我用的是Materialize CSS...
我遇到了类似的问题。当我在 Angular 中创建简历时,我想在屏幕大于 700px 时显示 mat-horizontal-stepper
,在屏幕小于它时显示 mat-vertical-stepper
。所以我创建了一个 HostListener
到 window:resize
事件。
This is my deployed resume, if you resize you can see the expected behavior.
And this is my component's TS file, at line 36 you can find the HostListener
.