微信小程序 slider的简单实例
实现效果图:
微信小程序slider应用,可加减的slider控制
页面结构
control1.max)
return
control.value += 10;
this.setData({
'controls': controls
})
},// 控制减
minusCount: function (event) {
let data = event.currentTarget.dataset
let controls = this.data.controls
let control = controls.find(function (v) {
return v.id == data.id
})
if (control.value <= 0)
return
control.value -= 10;
this.setData({
'controls': controls
})
},//拖动
sliderchange: function (e) {
let data = e.currentTarget.dataset
let controls = this.data.controls
let control = controls.find(function (v) {
return v.id == data.id
})
this.setData({
'controls': controls
})
}
})
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
原文链接:https://www.f2er.com/weapp/39875.html