


Introduction to the method of realizing shared variable values in WeChat applet
This article mainly introduces the relevant information on the implementation of shared variable values in WeChat mini programs. Friends in need can refer to
The implementation of shared variable values in WeChat mini programs
For example, from the product management list page, you can modify the product you published, click the modify button, and modify the product through the activityId unique identifier. We can pass the value of this activityId through page jump,
Obtained in onLoad,
Example:
onLoad: function (options) { var activityId = options.activityId; //获取值 this.data.activityId = activityId//设置在page里都可以进行调用
If I want to use the activityId variable in the form submission method now
Example:
submit: function(e){ var activityId = this.data.activityId //获取 activityId }
This way you can avoid using global variables to get values
The above is the detailed content of Introduction to the method of realizing shared variable values in WeChat applet. 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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Notepad++7.3.1
Easy-to-use and free code editor
