Bar*_*ali 5 css size angular-material mat-slider
所以我在这个项目中使用了 Mat Slider,并在其拇指上显示文本值,但拇指大小对于我的文本来说太小了!我寻找了很多改变拇指大小的方法,但我没有找到任何东西!我不太擅长 CSS,所以我不能乱搞它来尝试让它工作起来!你能帮我么 ?
编辑:
我想你正在寻找这样的东西
超文本标记语言
<mat-slider
thumbLabel
[displayWith]="formatLabel"
tickInterval="1000"
min="1"
max="100000" class="cdk-focused"></mat-slider>
Run Code Online (Sandbox Code Playgroud)
TS
import {Component} from '@angular/core';
@Component({
selector: 'slider-formatting-example',
templateUrl: 'slider-formatting-example.html',
styleUrls: ['slider-formatting-example.css'],
})
export class SliderFormattingExample {
formatLabel(value: number | null) {
if (!value) {
return 0;
}
if (value >= 1000) {
return Math.round(value / 1000) + 'k';
}
return value;
}
}
Run Code Online (Sandbox Code Playgroud)
CSS
mat-slider {
width: 300px;
}
Run Code Online (Sandbox Code Playgroud)