Home  >  Article  >  WeChat Applet  >  How to pass values ​​between applet pages

How to pass values ​​between applet pages

angryTom
angryTomOriginal
2020-03-25 12:07:213549browse

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
})

B page

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

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!

Statement:
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