Home > Web Front-end > JS Tutorial > How to display single options in WeChat mini program

How to display single options in WeChat mini program

亚连
Release: 2018-06-21 16:24:46
Original
2926 people have browsed it

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>
Copy after login

② index.js

Page({
 data:{
  // text:"这是一个页面"
  text:&#39;&#39;
 }, 
 radiogroupBindchange:function(e){
  console.log(e);
  this.setData({
   text:&#39;您选择了&#39;+e.detail.value
  })
 }
})
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template