当前位置:网站首页>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)边栏推荐
- TCP/IP四层模型
- 运维的高光时刻,从智能化开始
- Spark源码-任务提交流程之-6.1-sparkContext初始化-创建spark driver端执行环境SparkEnv
- Spark source code - task submission process - 6-sparkContext initialization
- 智能运维会取代人工运维吗?
- LinkSLA坚持用户第一,打造可持续的运维服务方案
- spark source code-RPC communication mechanism
- spark源码-RPC通信机制
- Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
- Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
猜你喜欢

【Day8】RAID Disk Array

什么?CDN缓存加速只适用于加速静态内容?

Mongodb query analyzer parsing
![[Day1] (Super detailed steps) Build a soft RAID disk array](/img/40/cda8e5522c2795e03c0d47e8a689f8.png)
[Day1] (Super detailed steps) Build a soft RAID disk array

Getting Started 11 Automatically add version numbers

Autoware中安装Yolo3目标检测模块遇到的问题

IP address and subnet division

有哪些事情是你做了运维才知道的?

unity实现第一人称漫游(保姆级教程)

Getting Started Doc 08 Conditional Plugins
随机推荐
Hugo搭建个人博客
IP packet format (ICMP protocol and ARP protocol)
7步完成云上监控
单臂路由与三成交换机
网络布线与数制转换
新一代解析技术——云解析
腾讯云消息队列CMQ
Getting Started 11 Automatically add version numbers
【Day1】(超详细步骤)构建软RAID磁盘阵列
图片压缩失效问题
The spark operator - coalesce operator
Apache configure reverse proxy
调用TensorFlow Objection Detection API进行目标检测并将检测结果保存至本地
账号与权限管理
I/O performance and reliability
运维的高光时刻,从智能化开始
IP address and subnet division
[Day6] File system permission management, file special permissions, hidden attributes
spark源码-任务提交流程之-3-ApplicationMaster
Image compression failure problem