当前位置:网站首页>Wechat applet page jump to pass parameters
Wechat applet page jump to pass parameters
2022-08-05 06:13:00 【CrazyQiQi】
First of all, there are APIs that can pass parameters when jumping to the applet page
- wx.navigateTo()
Keep the current page and jump to a page in the app.But can't jump to the tabbar page - wx.reLaunchTo()
Close all pages, open to a page in the app - wx.redirectTo()
Close the current page and jump to a page in the application.But it is not allowed to jump to the tabbar page.
When jumping with wx.navigateTo()
, it is necessary to convert the data of the json object into the form of a string
We need to perform a process similar to packing and unpacking the json array through these two functions.
JSON.stringify();//Convert json to string valueJSON.parse();//Convert the string toObject Receive
This is the json array we pass across pages
var json = [{"gender": "gender","weight": "weight"}]
The next step is to pass the path with parameters, convert the parameters into string format, and pass them to the target page
wx.navigateTo({//url fill in the page you want to jump tourl: './../index/index?json=' + JSON.stringify(json) //Convert json array to string
After passing at the same time, we need to take out the passed parameters on the target page
/** * Lifecycle function -- monitor page loading */onLoad: function (options) {var list = JSON.parse(options.json) //The string passed from the first page is converted into a json arrayconsole.log(list)
边栏推荐
- spark source code - task submission process - 1-sparkSubmit
- spark算子-parallelize算子
- 网络布线与数制转换
- Spark源码-任务提交流程之-6-sparkContext初始化
- LeetCode Interview Questions
- spark源码-任务提交流程之-1-sparkSubmit
- VRRP principle and command
- 入门文档06 向流(stream)中添加文件
- spark source code - task submission process - 3-ApplicationMaster
- CIPU,对云计算产业有什么影响
猜你喜欢
spark源码-任务提交流程之-7-流程梳理总结
Getting Started Doc 08 Conditional Plugins
【Machine Learning】1 Univariate Linear Regression
入门文档11 自动添加版本号
LinkSLA坚持用户第一,打造可持续的运维服务方案
One-arm routing and 30% switch
云计算——osi七层与TCP\IP协议
[Day8] (Super detailed steps) Use LVM to expand capacity
【机器学习】1单变量线性回归
[Day1] VMware software installation
随机推荐
Spark源码-任务提交流程之-6.1-sparkContext初始化-创建spark driver端执行环境SparkEnv
[Day1] VMware software installation
Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
spark source code - task submission process - 1-sparkSubmit
I217-V在openwrt软路由下大流量断网问题
网络不通?服务丢包?看这篇就够了
spark operator - map vs mapPartitions operator
传输层协议(TCP3次握手)
ROS视频教程
有哪些事情是你做了运维才知道的?
VLAN详解及实验
【机器学习】1单变量线性回归
spark算子-wholeTextFiles算子
实力卷王LinkSLA,实现运维工程师快乐摸鱼
入门文档04 一个任务依赖另外一个任务时,需要按顺序执行
Getting Started Document 07 Staged Output
时间复杂度和空间复杂度
Wireshark抓包及常用过滤方法
什么?CDN缓存加速只适用于加速静态内容?
VRRP principle and command