【发布时间】:2017-03-11 00:51:34
【问题描述】:
我想在 Angular2 Material 中的一个 fab 按钮内放置一个图像。 外观就是您登录 Google 或 Gmail 时的外观。
Angular2 Material 文档对此还没有任何内容。
例如,看这张图片:http://www.mattpaulson.com/wp-content/uploads/2014/03/gmail-zero.png
我一直在玩的代码(不起作用)是:
<button md-fab
type="button">
<img md-fab-image [src]="userInfo.photoUrl">
<div class="md-ripple-container"></div>
</button>
<button md-fab
type="button">
<img md-fab-image [src]="userInfo.photoUrl">
</button>
<button md-fab md-fab-image
type="button">
<img md-fab-image [src]="userInfo.photoUrl">
</button>
<button md-icon-button
type="button">
<img [src]="userInfo.photoUrl">
</button>
<button md-icon-button
md-fab-image
type="button">
<img [src]="userInfo.photoUrl">
</button>
<button md-icon-button md-fab-image
type="button">
<img md-fab-image [src]="userInfo.photoUrl">
</button>
<button md-icon-button md-fab-image
type="button">
<img md-fab-image [src]="userInfo.photoUrl">
</button>
不理想的破解
<button md-fab md-button
style="overflow:hidden;top:1rem;"
type="button">
<img [src]="userInfo.photoUrl" style="max-width:100%">
</button>
【问题讨论】: