如何从Mat-form-field中删除Mat-form-field-wrapper?

Aditya0033

我正在使用Angular mat-form-field,并且在更改CSS后使其看起来像mat-chip,我想摆脱这个外部盒子(mat-form-field-wrapper)。

需要摆脱包装

<div class="flex">
 <div class="etc">
  <mat-chip-list i18n-aria-label aria-label="Selected Roles">
  <form [formGroup]="filterForm" >
  <mat-form-field appearance="outline" class="no-line" >

  <mat-select
    i18n-aria-label
    i18n-placeholder
    disableOptionCentering
    multiple
    aria-label="Experience level filter"
    formControlName="experienceLevelsFilter"
     placeholder="Experience Level"
    panelClass="panel-below-field"
    (selectionChange)="filterChange($event, 'experienceLevels')"
   >
    <mat-select-trigger>
      Experience Level {{ getSelected("experienceLevels") }}
    </mat-select-trigger>

    <mat-option
      *ngFor="let experienceLevel of experienceLevels"
      class="experience-level-option"
      [value]="experienceLevel"  >
      {{ experienceLevel.getName() }}
    </mat-option>
    </mat-select>
   </mat-form-field> 
  </form>
 </mat-chip-list>
</div>
Stack7

请删除芯片列表标签,它应该可以正常工作。

码:

<div class="flex">
 <div class="etc">
  <form [formGroup]="filterForm" >
  <mat-form-field appearance="outline" class="no-line" >

  <mat-select
    i18n-aria-label
    i18n-placeholder
    disableOptionCentering
    multiple
    aria-label="Experience level filter"
    formControlName="experienceLevelsFilter"
     placeholder="Experience Level"
    panelClass="panel-below-field"
    (selectionChange)="filterChange($event, 'experienceLevels')"
   >
    <mat-select-trigger>
      Experience Level {{ getSelected("experienceLevels") }}
    </mat-select-trigger>

    <mat-option
      *ngFor="let experienceLevel of experienceLevels"
      class="experience-level-option"
      [value]="experienceLevel"  >
      {{ experienceLevel.getName() }}
     </mat-option>
    </mat-select>
   </mat-form-field> 
  </form>
</div>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

mat-form-field必须包含MatFormFieldControl

在mat-form-field中更改边框颜色

如何在mat-form-field元素中的下划线类之间添加空间?

为什么在此FormArray中无法编辑mat-form-field?

无法从mat-form-field获取选定的选项以在angular2中动态生成url

如何为mat-form-field设置聚焦的边框线颜色

如果mat-form-field在组件中,则表单布局会中断

mat-form-field始终显示所需的红色?

如何在Angular Material的mat-form-field中添加文本修饰?

mat-form-field必须包含MatFormFieldControl并且已经导入

如何在mat-form-field的输入中获取点击事件?

解决错误后,mat-form-field不会删除mat-form-field-invalid类

提交后未在表单中捕获mat-form-field中的值

与mat-form-field中的matSuffix mat-checkbox交互

如何基于值禁用角度的mat-form-field?

如何在单独页面的mat-form-field上应用两种不同的CSS?

在触摸控件之前显示mat-form-field错误消息

正确的方法来填充和删除mat-form-field的边距

mat-list-item 重叠中的 mat-form-field

我如何正确使用 mat-form-field 来获取输入值(更新)

Mat-form-field 在不同的浏览器中具有不同的高度

如何删除mat-form-field Angular Material中的[object Object]

是否可以调整 mat-form-field-outline 的厚度?

angular - 覆盖 mat-form-field 继承的样式

如何调整mat-form-field mat-chip的大小?

Angular 12- mat-form-field 超出搜索栏

将拖放添加到 mat-form-field 中的 mat-chip 列表

mat-form-field 占位符文本未对齐

为什么 mat-form-field 没有出现?