This article mainly introduces the use of radio display single option function in WeChat applet, involving operation techniques related to radio component event response, and comes with source code for readers to download and refer to. Friends in need can refer to this article
The example describes how the WeChat applet uses radio to display a single option function. Share it with everyone for your reference, as follows:
Key code
① index.wxml
<radio-group bindchange="radiogroupBindchange"> <radio value="radio1">radio1</radio> <radio value="radio2">radio2</radio> <radio value="radio3">radio3</radio> </radio-group> <view>提示:{{text}}</view>
② index.js
Page({ data:{ // text:"这是一个页面" text:'' }, radiogroupBindchange:function(e){ console.log(e); this.setData({ text:'您选择了'+e.detail.value }) } })
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to develop AngularJS 2 applications using the VS Code editor
About SPA first screen loading optimization in Vue (Detailed tutorial)
About the usage of the pipe operator (|) in Angular
About modifying the selected text or code in the VS Code editor Color operation
How to use the request network to perform request operations in the WeChat applet
How to implement the array update function in VUE
Using modular development in vuejs
What should we pay attention to when optimizing Vue projects?
How to implement component communication in vue-cli
Use angular to write the Message component
How to bind Json data source using EasyUI
The above is the detailed content of How to display single options in WeChat mini program. For more information, please follow other related articles on the PHP Chinese website!