HomeDocs
Skip to main content

Slider

Introduction

Slider is a sliding input component used for selecting values within a numerical range or a custom range.

Property Description

FieldDescriptionTypeDefault
valueThe selected value of the slider, can be bound using v-model.Number-
showLabelWhether to display the label while dragging.BooleanFALSE
showLabelAlwaysWhether to always display the label.BooleanFALSE
showRangeTxtWhether to display the selectable range at both ends.BooleanFALSE
stageThe number of segments.Number/String-

Events

NameDescriptionCallback Parameters
changeTriggered when slidingvalue

Example

<view class="bg-white br4 pd16">
<slider
class="pd16"
:range="range"
stage="50"
:value="sliderVal"
:show-label="true"
bind:change="handleSlideChange"
></slider>
<view>{{sliderVal}}</view>
</view>
Page({
data: {
text: 'button',
range: [0, 100],
sliderVal: 10,
},
handleSlideChange(val) {
this.setData({
sliderVal: val,
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.