欢迎光临
我们一直在努力

slider滑动选择器怎么用

这篇文章主要介绍了slider滑动选择器怎么用的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇slider滑动选择器怎么用文章都会有所收获,下面我们一起来看看吧。

slider


滑动选择器。

属性名 类型 默认值 说明
min Number 0 最小值
max Number 100 最大值
step Number 1 步长,取值必须大于 0,并且可被(max – min)整除
disabled Boolean false 是否禁用
value Number 0 当前取值
color Color #e9e9e9 背景条的颜色(请使用 backgroundColor)
selected-color Color #1aad19 已选择的颜色(请使用 activeColor)
activeColor Color #1aad19 已选择的颜色
backgroundColor Color #e9e9e9 背景条的颜色
show-value Boolean false 是否显示当前 value
bindchange EventHandle   完成一次拖动后触发的事件,event.detail = {value: value}

示例代码:

<view class="section section_gap"><text class="section__title">设置left/right icon</text><view class="body-view"><slider bindchange="slider1change" left-icon="cancel" right-icon="success_no_circle"/></view></view><view class="section section_gap"><text class="section__title">设置step</text><view class="body-view"><slider bindchange="slider2change" step="5"/></view></view><view class="section section_gap"><text class="section__title">显示当前value</text><view class="body-view"><slider bindchange="slider3change" show-value/></view></view><view class="section section_gap"><text class="section__title">设置最小/最大值</text><view class="body-view"><slider bindchange="slider4change" min="50" max="200" show-value/></view></view>
var pageData = {}for(var i = 1; i < 5; ++i) {
  (function (index) {
    pageData['slider' + index + 'change'] = function(e) {      console.log('slider' + 'index' + '发生 change 事件,携带值为', e.detail.value)
    }
  })(i);
}
Page(pageData)

关于“slider滑动选择器怎么用”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“slider滑动选择器怎么用”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注云搜网行业资讯频道。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。