【发布时间】:2018-04-19 23:13:58
【问题描述】:
当用户进行搜索时,我正在从 Api 生成卡片。
我有电影列表组件,我可以在其中展示我的卡片
这是 HTML
<div fxLayout='row' fxLayoutWrap class="cards">
<div fxFlex="20" class="example-card" *ngFor="let film of dataResult.results">
<mat-card>
<mat-card-header>
<mat-card-title>{{film.title}}</mat-card-title>
<mat-card-subtitle>{{film.release_date}}
</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src="http://image.tmdb.org/t/p/w185/{{film.poster_path}}" alt="Photo of a Shiba Inu">
<mat-card-content>
<p>
{{film.overview}}
</p>
</mat-card-content>
<mat-card-actions>
<button mat-button>
<mat-icon>favorite</mat-icon>
</button>
<button mat-button>SHARE</button>
</mat-card-actions>
</mat-card>
</div>
</div>
和 CSS
.example-card {
min-width: 100%;
margin: 40px;
}
.cards {
width: 400px;
}
服务正在运行,并且组件 ts 逻辑。
我的问题是当我使用fxLayoutWrap 包装内容时,当 fxFlex 获得 100 的值时,材料卡没有换行。
这是stacklitz demo(我在调用 API 时遇到 https 错误,如果有人可以修复它,我将不胜感激)
这是我的问题的屏幕截图
【问题讨论】:
标签: html css angular angular-material angular-flex-layout