小程序开放平台

文档中心
表单组件
button
checkbox
checkbox-group
editor
form
input
label
picker
picker-view
picker-view-column
radio
radio-group
slider
switch
textarea
基础内容
媒体组件
地图
视图容器
开放能力
画布

slider

开发
>
组件
>
表单组件
>
slider
>
更新时间:2024-11-13 19:05:26

slider

滑动选择器

属性
类型
默认值
必填
说明
minnumber0最小值
maxnumber100最大值
stepnumber1步长,取值必须大于 0,并且可被(max - min)整除
disabledbooleanfalse是否禁用
valuenumber0当前取值
active-colorstring#1aad19已选择的颜色
background-colorstring#e9e9e9背景条的颜色
block-sizenumber28滑块的大小,取值范围为 12 - 28
block-colorstring#ffffff滑块的颜色
show-valuebooleanfalse是否显示当前 value
bindchangeeventhandle完成一次拖动后触发的事件,event.detail = {value}
bindchangingeventhandle拖动过程中触发的事件,event.detail = {value}

扫码预览

组件示例

<view class="page-section page-section-gap">
  <view class="progress-box">
    <progress percent="20" show-info stroke-width="3"/>
  </view>

  <view class="progress-box">
    <progress percent="40" active stroke-width="3" />
    <icon class="progress-cancel" type="cancel"></icon>
  </view>

  <view class="progress-box">
    <progress percent="60" active stroke-width="3" />
  </view>

  <view class="progress-box">
    <progress percent="80" color="#10AEFF" active stroke-width="3" />
  </view>
</view>
该文档是否对您有帮助?