WeChat applet slider component usage details, slider Usage Details

Source: Internet
Author: User

The usage of the applet slider component is described in detail.

This article shares with you how to use the applet slider component for your reference. The specific content is as follows:

WXML

<View class = "tui-content"> <view class = "tui-slider-head"> set step. The current step is 5. Current value: {slider1 }}</view> <view class = "tui-slider-box"> <slider bindchange = "changeSlider1" step = "5" value = "{slider1}} "/> </view> <view class =" tui-content "> <view class =" tui-slider-head "> whether to display the current value on the right </view> <view class = "tui-slider-box"> <slider bindchange = "changeSlider2" value = "{slider2 }}" show-value/> </view> </view> <view class = "tui-content"> <view class = "tui-slider-head"> set the maximum and minimum values </view> <view class =" tui-slider-box "> <slider bindchange =" changeSlider3 "min =" 20 "max =" 90 "value =" {slider3 }}" show-value/> </ view> </view> <view class = "tui-content"> <view class = "tui-slider-head"> sliding selector setting name </view> <view class = "tui-slider-box"> <view class = "tui-fl"> select </view> <view class = "tui-fl" >{{ slider4 }}</ view> <view style = "overflow: hidden "> <slider bindchanging =" changeSlider4 "value =" {slider4 }}"/> </view>

WXSS

.tui-slider-head,.tui-slider-box{ height: 80rpx; line-height: 80rpx; font-size: 35rpx; color: #666;}

JS

Page({ data: {  slider1: 50,  slider2: 50,  slider3: 50,  slider4: 50 }, changeSlider1(e) {  this.setData({ slider1: e.detail.value }) }, changeSlider2(e){  this.setData({ slider2: e.detail.value}) }, changeSlider3(e) {  this.setData({ slider3: e.detail.value }) }, changeSlider4(e) {  this.setData({ slider4: e.detail.value }) }})

Note: two events of the slider component are triggered when bindchanging is dragged, and when bindchange is dragged once, it is triggered!

Download DEMO

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.