如何让 mat-card material 2 组件中的内容可以滚动?我在 Material 2网站上没有找到任何内容
最佳答案
这不是内置功能。要使内容可滚动,请为 <mat-card-content>
设置高度选择器。这是一个例子:
<mat-card>
<mat-card-header>
<mat-card-title>CARD TITLE</mat-card-title>
</mat-card-header>
<mat-card-content [style.overflow]="'auto'" [style.height.px]="'300'">
<p>
The Shiba Inu is the smallest of the six original and distinct
spitz breeds of dog from Japan. A small, agile dog that copes very
well with mountainous terrain, the Shiba Inu was originally bred
for hunting.
</p>
</mat-card-content>
<mat-card-actions>
<button mat-button>LIKE</button>
<button mat-button>SHARE</button>
</mat-card-actions>
</mat-card>
链接到 StackBlitz demo .
关于 Angular Material 2 卡片可滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46906665/