In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you how WeChat Mini Programs can transfer values between different pages. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article, let's take a look at it.
When we are developing WeChat Mini Programs, we often encounter values passed between different pages, and we encounter 100% of them.
In general, it is the value passed by the page jump. I have an example here. The example is in the Input input box, when the user enters
After the information is saved and submitted, the page is redirected, and the content entered by the user just now is passed into the new page.
1minute input input box and submit button
Username is the key value and bindinput is the bound js event
Save
The bindtap here is also the js event I want to bind.
2. Register the above two bindings in js. The wx.setStorageSync here can go to the official documentation of Wechat to see its role.
ClickButton: function () {
Wx.setStorageSync ('uesrname', this.data.uesrname)
Wx.switchTab ({
Url:'.. / index/index'
})
}
InputUser: function (e) {
This.setData ({
Uesrname: e.detail.value
})
}
3, declare a global variable to username in app.js
4, add to the page of the onload to be redirected
Var uesrname = wx.getStorageSync ('uesrname')
That.setData ({uesrname: uesrname})
5, introduce {{username}} into wxml
These are all the contents of the article "how to transfer values between different pages by WeChat Mini Programs". Thank you for your reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.