Analysis of the open type attribute principle of button tag in wechat applet

Time:2020-2-16

This article mainly introduces the principle analysis of button tag open type attribute of wechat applet. The example code is introduced in detail in this article, which has certain reference learning value for everyone’s study or work. You can refer to the following for your friends

Open type: one of the legal values:

GetUserInfo Description: guide user authorization to obtain user information, which can be obtained from bindgetuserinfo callback

The bindgetuserinfo attribute of the button indicates that when the user clicks the button, the obtained user information will be returned. The detail data of the callback is the same as that of wx.getuserinfo, which is valid when open type = “getUserInfo”

Such as:

1:

Wxml file:

.js file:

Two:

Wxml file:

.js file:

In this way, users are required to authorize when clicking, and obtain user information (open type = “getUserInfo”) when authorizing login (bindgetuserinfo = “user defined function name”)!

(or get the user information (open type = “getUserInfo”) to authorize login (bindetuserinfo = “user defined function name”))

The above is the whole content of this article. I hope it will help you in your study, and I hope you can support developepaer more.

Recommended Today

The application of USB camera in rk3399

The application of USB camera in rk3399 1, introduction UVCFull nameUSB Video Class, is a set of standard customized by usb-if. All USB interface cameras complying with this standard can almost be used directly under Windows Linux and other systems, achieving the similar effect of drive free. Of course, it doesn’t mean that there is […]