当前位置:网站首页>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 stringAfter 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)边栏推荐
- 入门文档05-2 使用return指示当前任务已完成
- Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
- 入门文档05 使用cb()指示当前任务已完成
- The problem of calling ds18b20 through a single bus
- 深度 Zabbix 使用指南——来自惨绿少年
- 入门文档04 一个任务依赖另外一个任务时,需要按顺序执行
- Three modes of vim
- I217-V network disconnection problem in large traffic under openwrt soft routing
- spark算子-textFile算子
- Autoware--北科天绘rfans激光雷达使用相机&激光雷达联合标定文件验证点云图像融合效果
猜你喜欢
随机推荐
【Day8】使用LVM扩容所涉及的命令
[Day1] (Super detailed steps) Build a soft RAID disk array
Getting Started Documentation 12 webserve + Hot Updates
spark算子-parallelize算子
ACLs and NATs
Spark源码-任务提交流程之-6.1-sparkContext初始化-创建spark driver端执行环境SparkEnv
Three modes of vim
IP address and subnet division
有哪些事情是你做了运维才知道的?
OpenCV3.0 is compatible with VS2010 and VS2013
入门文档05-2 使用return指示当前任务已完成
spark源码-任务提交流程之-3-ApplicationMaster
dsf5.0新建页面访问时重定向到首页的问题
Regular expression small example - get number character and repeated the most
图片压缩失效问题
VRRP原理及命令
【Day8】(超详细步骤)使用LVM扩容
监控系统的内卷,有什么讲究?
The spark operator - repartition operator
入门文档10 资源映射








