当前位置:网站首页>uni-app---uni.navigateTo跳转传参使用
uni-app---uni.navigateTo跳转传参使用
2022-07-05 09:26:00 【左手牵**右手】
uni-app有自己语法。我们使用的时候传参,传字符串或对象,
字符串传参数:可以拼接地址
goreportdetails(id) {
uni.navigateTo({
url: '/pages/reportdetails/reportdetails?id=' + id + '&name=edit'
})
},
对象传参数:有些时候参数会丢失,所以借助encodeURIComponent
uni.navigateTo({
url: '/pages/build/build?list=' + encodeURIComponent(JSON.stringify(this.itemList)) + '&name=' + this.name +'&totalScore=' + this.totalScore + '&content=' + this.content+ '&uid=' + this.uid,
})
那么接收参数就:
onLoad(option) {
if (option) {
this.name = option.name
this.uid = option.uid
if (option.list) {
this.list = JSON.parse(decodeURIComponent(option.list));
}
}
}
边栏推荐
- Talking about the difference between unittest and pytest
- Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
- C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
- C # compare the differences between the two images
- Applet (subcontracting)
- fs. Path module
- STM32简易多级菜单(数组查表法)
- 驾驶证体检医院(114---2 挂对应的医院司机体检)
- Hi Fun Summer, play SQL planner with starrocks!
- nodejs_ 01_ fs. readFile
猜你喜欢

信息與熵,你想知道的都在這裏了

Introduction Guide to stereo vision (6): level constraints and polar correction of fusiello method

顶会论文看图对比学习(GNN+CL)研究趋势

LeetCode 556. 下一个更大元素 III

Editor use of VI and VIM

Applet global style configuration window

图神经网络+对比学习,下一步去哪?

【ManageEngine】如何利用好OpManager的报表功能

fs. Path module

AUTOSAR from getting started to mastering 100 lectures (103) -dbc file format and creation details
随机推荐
2011-11-21 training record personal training (III)
3D reconstruction open source code summary [keep updated]
[code practice] [stereo matching series] Classic ad census: (4) cross domain cost aggregation
Unity SKFramework框架(二十三)、MiniMap 小地图工具
Thermometer based on STM32 single chip microcomputer (with face detection)
2310. 个位数字为 K 的整数之和
Priority queue (heap)
Unity skframework framework (XXII), runtime console runtime debugging tool
AUTOSAR from getting started to mastering 100 lectures (103) -dbc file format and creation details
Kotlin introductory notes (VIII) collection and traversal
Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
Driver's license physical examination hospital (114-2 hang up the corresponding hospital driver physical examination)
Cloud computing technology hotspot
LeetCode 556. 下一个更大元素 III
Alibaba's ten-year test brings you into the world of APP testing
STM32简易多级菜单(数组查表法)
Explain NN in pytorch in simple terms CrossEntropyLoss
np. allclose
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
My life