角度材料2卡可滚动

前端之家收集整理的这篇文章主要介绍了角度材料2卡可滚动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何使mat-card材料2组件内的内容滚动?我没有在材料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.

猜你在找的Angularjs相关文章