当前位置:网站首页>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)边栏推荐
- I/O performance and reliability
- [Day6] File system permission management, file special permissions, hidden attributes
- 【机器学习】1单变量线性回归
- spark source code - task submission process - 5-CoarseGrainedExecutorBackend
- Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
- [Day1] VMware software installation
- vim的三种模式
- Getting Started Doc 08 Conditional Plugins
- I217-V在openwrt软路由下大流量断网问题
- spark source code-RPC communication mechanism
猜你喜欢
随机推荐
ROS video tutorial
通过单总线调用ds18b20的问题
spark源码-任务提交流程之-3-ApplicationMaster
Spark源码-任务提交流程之-6.1-sparkContext初始化-创建spark driver端执行环境SparkEnv
Getting Started Document 07 Staged Output
【Day6】文件系统权限管理 文件特殊权限 隐藏属性
【Day8】(超详细步骤)使用LVM扩容
IP address and subnet division
Apache configure reverse proxy
dsf5.0 弹框点确定没有返回值的问题
VRRP原理及命令
【Day1】(超详细步骤)构建软RAID磁盘阵列
网络不通?服务丢包?看这篇就够了
spark source code - task submission process - 2-YarnClusterApplication
运维工程师,快来薅羊毛
The idea of commonly used shortcut key
Getting Started 04 When a task depends on another task, it needs to be executed in sequence
Spark source code - task submission process - 4-container to start executor
lvm logical volume and disk quota
The problem of redirecting to the home page when visiting a new page in dsf5.0








