【发布时间】:2019-09-23 07:55:29
【问题描述】:
【问题讨论】:
【问题讨论】:
Angular Material 默认不提供此功能,但您可以通过在全局 css 文件中添加以下 css 来解决此问题:
.mat-slider-thumb-label {
transform: rotate(45deg) !important;
border-radius: 50% 50% 0 !important;
}
.mat-slider-thumb {
transform: scale(0) !important;
}
.mat-slider-thumb-label-text {
opacity: 1 !important;
}
stackblitz 上的工作演示
【讨论】:
在我将它包裹在 ng-deep 中之前,接受的答案对我来说并不能始终如一地工作
::ng-deep {
.mat-slider-thumb-label {
transform: rotate(45deg) !important;
border-radius: 50% 50% 0 !important;
}
.mat-slider-thumb {
transform: scale(0) !important;
}
.mat-slider-thumb-label-text {
opacity: 1 !important;
}
}
此解决方案来自 michaelpwilson:https://github.com/angular/components/issues/4803
【讨论】: