首页 > 解决方案 > 如何在 mat-menu 按钮中不换行?

问题描述

我有mat-menu

<mat-menu #menu="matMenu">
      <button *ngFor="let doc of docs; let i = index" mat-menu-item>
             {{ i + 1 }}. {{ doc.name }} // Here long text
      </button>
</mat-menu>

如果文本这么长,如何将文本换行<button>并删除点?

我努力了:white-space: nowrap

标签: cssangular

解决方案


您可以重置 css 属性:

white-space: normal;
overflow: visible;
text-overflow: clip;

推荐阅读