Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize WeChat Mini Programs picker Selector

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to implement WeChat Mini Programs picker selector". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "how to implement WeChat Mini Programs picker selector"!

Picker selector is divided into three types, normal selector, time selector, date selector is distinguished by mode attribute, the default is normal selector.

Implementation of Mini Program picker Selector

Wxml

Normal selector {{array [index]}} time selector {{time}} date selector {{date}}

Js

Page ({

Data: {

/ / text: "this is a page"

Array: ['Android',' IOS', 'ReactNativ',' WeChat', 'Web']

Index: 0

Time: '08purl 30'

Date: '2016-09-26'

}

/ * *

* listen for normal picker selector

, /

ListenerPickerSelected: function (e) {

/ / change the index value and redraw the interface through the setData () method

This.setData ({

Index: e.detail.value

});

}

/ * *

* listening time picker selector

, /

ListenerTimePickerSelected: function (e) {

/ / call setData () to redraw

This.setData ({

Time: e.detail.value

});

}

/ * *

* listening date picker selector

, /

ListenerDatePickerSelected:function (e) {

This.setDate ({

Date: e.detail.value

})

}

OnLoad:function (options) {

/ / parameters brought by page initialization options for page jump

}

OnReady:function () {

/ / Page rendering completed

}

OnShow:function () {

/ / Page display

}

OnHide:function () {

/ / Page hiding

}

OnUnload:function () {

/ / Page closes

}

})

At this point, I believe you have a deeper understanding of "WeChat Mini Programs picker selector how to achieve", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report