使用 angular-material 中的图标创建 <md-switch>
Create <md-switch> with icon in angular-material
如何创建带有图标的 md-switch?
为例
谢谢
您可以在 .md-thumb
class
中添加一个 background-image
.md-thumb{
background: url('imageUrl');
background-size: cover;
}
编辑:
打开显示图标:
.md-checked .md-thumb{
background: url('imageUrl');
background-size: cover;
}
关闭时显示图标:
.md-checked .md-thumb{
background: none;
}
.md-thumb{
background: url('imageUrl');
background-size: cover;
}
如何创建带有图标的 md-switch?
为例谢谢
您可以在 .md-thumb
class
background-image
.md-thumb{
background: url('imageUrl');
background-size: cover;
}
编辑:
打开显示图标:
.md-checked .md-thumb{
background: url('imageUrl');
background-size: cover;
}
关闭时显示图标:
.md-checked .md-thumb{
background: none;
}
.md-thumb{
background: url('imageUrl');
background-size: cover;
}