angular - 为 Angular Material 步进器中的一步分配全宽
问题描述
对于我的项目,我正在使用 Angular Material Stepper 组件,正如文档中所建议的那样
但是当我运行步进器时,文本区域的实际宽度(第一步)对于我的任务(红色矩形)来说太小了。是否可以将步进器中的步进宽度扩展到最大尺寸(绿色矩形)。
第一步文本区域的标记如下所示:
<mat-step [stepControl]="firstFormGroup">
<form [formGroup]="firstFormGroup">
<ng-template matStepLabel>Raw text</ng-template>
<mat-form-field appearance="outline">
<mat-label>Input raw text here</mat-label>
<textarea
matInput
rows="15"
placeholder="Raw text"
required
[(ngModel)]="sourceText"
></textarea>
</mat-form-field>
<div>
<button mat-button matStepperNext>Next</button>
</div>
</form>
</mat-step>
我已经尝试使用这里建议的 css 代码:
::ng-deep .mat-horizontal-stepper-content[aria-expanded="false"] {
width: 0px !important;
}
但是没有效果。
简历:有没有办法将红色方块(如上图所示)中的文本区域扩展到绿色方块的宽度?
解决方案
<mat-form-field appearance="outline" class='w100'>
<mat-label>Input raw text here</mat-label>
<textarea
matInput
rows="15"
placeholder="Raw text"
required
[(ngModel)]="sourceText"
></textarea>
</mat-form-field>
在 CSS 中
.w100{
width : 100%;
}
推荐阅读
- flutter - 在 pubspec.yaml 中检测到错误:第 49 行第 13 列错误:此处不允许映射值。你之前错过了一个冒号吗?╷ 49 │ 字体:│ ^
- mysql - 无法对包含 MySql 中的聚合或子查询的表达式执行聚合函数
- ssh - Spark 会话运行但从属服务器不会运行
- function - 如何使用 matlab 函数的设置输出复杂的绘图
- python - 为什么 Deep Learning with TensorFlow 提供的代码结果与其书中的快照不同
- sql - 将另一个表中的逐行值转换为字符串并将其插入到 SQL 中的 NOT IN 子句中
- javascript - 返回数组的子数组中最大数的数组
- selenium - 如何使用 selenium testng 代码对多个 testng 方法使用 dataProvider
- html - Django - 自定义表单,特别是字段的外观
- react-native - 意外的令牌,在 React Native 中应为“=>”