【问题标题】:Using multiple <mat-chip> tags within <mat-list-item>在 <mat-list-item> 中使用多个 <mat-chip> 标签
【发布时间】:2019-11-09 09:15:32
【问题描述】:

我在标签&lt;mat-list-item&gt; 中使用了多个&lt;mat-chip&gt; 标签。我的问题是下一个&lt;mat-list-item&gt; 不会下移。它只是保持相同的位置,几乎不可读。我用过matLine,但这似乎不是解决方案。

<mat-list>
  <mat-list-item *ngFor="let message of messages">
    <mat-icon matListIcon>folder</mat-icon>
    <h3 matLine> {{message.from}} </h3>
    <p matLine>
      <span> {{message.subject}} </span>
      <span class="demo-2">
                        <mat-chip-list>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>
                  <mat-chip color="primary" selected>Tag</mat-chip>

                </mat-chip-list>
      </span>
    </p>
  </mat-list-item>
</mat-list>

请给自己拍张照片:https://stackblitz.com/edit/list-examples-jxhvsn?file=index.html

我该如何解决这个问题?

【问题讨论】:

    标签: css angular angular-material


    【解决方案1】:

    我发现高度是问题所在。

    mat-list-item {
      height: auto !important
    }
    

    这会解决它。

    【讨论】:

      猜你喜欢
      • 2018-12-29
      • 1970-01-01
      • 2022-11-16
      • 2021-07-12
      • 2019-04-28
      • 1970-01-01
      • 2021-05-05
      • 1970-01-01
      相关资源
      最近更新 更多