Pic*_*cci 2 angular-material2 angular
我正在使用 Angular Material 滑块,我想在滑块的两端显示代表滑块设置的最小值和最大值的标签。或者,我想显示一个带有点和相对标签的比例,显示哪个值与哪个点相关。这是 javascript 库提供的其他滑块中存在的功能,但我在 Angular Material 滑块 API 中没有找到类似的功能。我想知道使用 Angular Material 提供的滑块是否也可以获得类似的行为。
Angular Material 的滑块组件的文档页面上清楚地提供了答案。
<md-slider
min="1" max="5" // min & max values
step="0.5" // step at which the slider control moves, if not given it will move smoothly
tickInterval="1" // interval at which a tick is shown on the slider, if not given there will be none
thumbLabel // show the selected value when the user moves the slider
value="1" // initial value
></md-slider>
Run Code Online (Sandbox Code Playgroud)
您无法使用组件的控件显示最小值和最大值,因为材料设计指南不允许这样做。但您只需将它们自己添加到模板中就足够简单了。例如,类似:
<span class="text-small">1</span><md-slider></md-slider><span class="text-small">5</span>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12370 次 |
| 最近记录: |