Home > WeChat Applet > Mini Program Development > How to pass values ​​between applet pages

How to pass values ​​between applet pages

angryTom
Release: 2020-03-25 12:07:21
Original
3581 people have browsed it

How to pass values ​​between applet pages

How the mini program transfers values ​​between pages

The mini program provides pages in the page jump API wx.navigateTo How to write value-passing, used between parameters and paths? Separate, parameter keys and values ​​are connected with =, and different parameters are connected with &.

How to pass values ​​between applet pages

Usage example: Pass value from page A to page B

A page

var txt = 'abc'
wx.navigateTo({
    url: '../Bpage/index?msg=' + txt
})
Copy after login

B page

// 生命周期函数,监听页面加载
onLoad: function(options) {
    // 获取URL里的参数
    var txt = options.txt
    console.log(txt)
}
Copy after login

PHP Chinese website, a large number of free small program development tutorials, welcome to learn!

The above is the detailed content of How to pass values ​​between applet pages. 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