角料2张可滚动卡片 [英] Angular material 2 card scroll able

查看:25
本文介绍了角料2张可滚动卡片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使垫卡材料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

这篇关于角料2张可滚动卡片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆