angular - 强制 Angular flex-layout 检查布局大小
问题描述
我正在使用 Angular8 的 flex-layout 并使用黄金布局在可停靠窗口中排列我的组件,我的问题是我的组件中的布局仅在我调整浏览器窗口大小时根据 flex-layout 更改,并且当我调整大小时组件窗口没有任何改变,就像我想的那样,没有通知像 flex-layout 这样的调整大小。
<div fxLayout="row wrap" fxLayout.xs="column">
<label fxFlex="50">Name: </label>
<mat-form-field fxFlex="50">
<input matInput [ngModel]="_name" placeholder="Feature name" name="tst">
</mat-form-field>
<label fxFlex="50">Description: </label>
<mat-form-field fxFlex="50">
<input matInput [ngModel]="_desc" placeholder="Feature Description" name="tstD">
</mat-form-field>
</div>
当组件的窗口宽度低于 599 像素时,我的布局应该更改column
,但这仅在我调整浏览器窗口大小时才会发生。
我的想法是对的吗?如果是,我如何通知 flex-layout 组件的窗口大小变化?
解决方案
推荐阅读
- microsoft-graph-api - 无法从图形 API 检索 Outlook 加载项自定义属性
- flutter - 在应用购买中颤动,productDetails 为空……知道为什么吗?
- mmenu - 取消修复 mmenu 导航栏
- go - 方法打印正确的数据,但在 Go 中返回未经编辑的数据
- javascript - 使用 python selenium webdriver 从提示警报中获取文本
- asp.net-core - Xamarin 的客户端 Microsoft BITS 连接?
- nginx - 如何使用 Nginx 自定义注解
- winapi - 防止 MS Windows 在辅助显示器上绘图
- javascript - 在 React 中使用 Hooks 获取单选按钮的值
- python - 将 venv 外观添加到 conda env