This article mainly introduces the detailed explanation and example code of the WeChat applet Introduction to WeChat applet slider. Friends in need can refer to the
implementation renderings:
Sliding selector
Attribute name | Type | Default value | Description |
---|---|---|---|
min | Number | 0 | Minimum |
max | Number | 100 | Maximum value |
step | Number | 1 | Step size, the value must be greater than 0 and divisible by (max - min) |
disabled | Boolean | false | Whether to disable |
value | Number | 0 | Current value |
show-value | Boolean | false | Whether to display the current value |
bindchange | EventHandle | Event triggered after completing a drag, event.detail = {value:value} |
Example Code:
<view class="section section_gap"> <text class="section__title">设置left/right icon</text> <view class="body-view"> <Introduction to WeChat applet slider bindchange="Introduction to WeChat applet 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"> <Introduction to WeChat applet slider bindchange="Introduction to WeChat applet slider2change" step="5"/> </view> </view> <view class="section section_gap"> <text class="section__title">显示当前value</text> <view class="body-view"> <Introduction to WeChat applet slider bindchange="Introduction to WeChat applet slider3change" show-value/> </view> </view> <view class="section section_gap"> <text class="section__title">设置最小/最大值</text> <view class="body-view"> <Introduction to WeChat applet slider bindchange="Introduction to WeChat applet slider4change" min="50" max="200" show-value/> </view> </view>
var pageData = {} for(var i = 1; i < 5; ++i) { (function (index) { pageData[`Introduction to WeChat applet slider${index}change`] = function(e) { console.log(`Introduction to WeChat applet slider${index}发生change事件,携带值为`, e.detail.value) } })(i); } Page(pageData)
#The above is the entire content of this article, I hope it will be useful for everyone’s learning For help, please pay attention to the PHP Chinese website for more related content!
Related recommendations:
Introduction to the top tab (swiper) implementation of WeChat mini program
WeChat mini program implementation ScrollTab component in YDUI
Introduction to the use of the WeChat applet progress component
The above is the detailed content of Introduction to WeChat applet slider. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Mac version
God-level code editing software (SublimeText3)