我已经自定义了范围滑块的宽度和高度,但标签“图例”无法编辑。我必须将标签文本放置在我的范围指针内
html:
<ng5-slider [(value)]="valueOne" [options]="ValueOpt"></ng5-slider>
打字稿:
valueOne = 0;
ValueOpt: Options = {
vertical: true,
showSelectionBar: false,
showTicksValues: false,
disabled: true,
stepsArray: [
{ value: 0, legend: 'Off' },
{ value: 20, legend: 'Very low' },
{ value: 40, legend: 'Low' },
{ value: 60, legend: 'Neutral' },
{ value: 80, legend: 'high' },
{ value: 100, legend: 'Very high' }
]
hideLimitLabels: true,
translate: (valueOne: number, label: LabelType): string => {
console.log();
switch (valueOne) {
case 0:
return '<b>Off</b>';
case 20:
return '<b>Very low</b>';
case 40:
return '<b>Low</b>';
case 60:
return '<b>Netural</b>';
case 80:
return '<b>High</b>';
case 100:
return '<b>Very high</b>';
default: return ' ';
}
}
}