Javascript 如何在mat select中以两行显示数据?

Javascript 如何在mat select中以两行显示数据?,javascript,html,css,angular,Javascript,Html,Css,Angular,在mat select中,选项的字符串太长,所选选项应在同一下拉列表中显示在两行中 现在字符串看起来不完整 Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是行业标准的虚拟文本 我想要这样的东西 似乎有一些过时的答案。 对于Angular Material 11,您可以通过调整css of mat选项轻松实现这一点 第1行 第2行 .multiline-mat-option.mat-option{ 空白:正常; 线高:正常; } 似乎有一些

在mat select中,选项的字符串太长,所选选项应在同一下拉列表中显示在两行中

现在字符串看起来不完整


Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是行业标准的虚拟文本
我想要这样的东西


似乎有一些过时的答案。
对于Angular Material 11,您可以通过调整css of mat选项轻松实现这一点


第1行
第2行
.multiline-mat-option.mat-option{
空白:正常;
线高:正常;
}

似乎有一些过时的答案。
对于Angular Material 11,您可以通过调整css of mat选项轻松实现这一点


第1行
第2行
.multiline-mat-option.mat-option{
空白:正常;
线高:正常;
}

这是否回答了您的问题?这回答了你的问题吗?
<mat-form-field class="form-field">
    <mat-select formControlName="foo">
        <mat-option value="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s">
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
        </mat-option>
     </mat-select>
</mat-form-field>