当前位置:网站首页>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));
}
}
}
边栏推荐
- Explain NN in pytorch in simple terms CrossEntropyLoss
- OpenGL - Coordinate Systems
- Deep understanding of C language pointer
- Thermometer based on STM32 single chip microcomputer (with face detection)
- C # draw Bezier curve with control points for lattice images and vector graphics
- OpenGL - Model Loading
- Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
- Node collaboration and publishing
- Unity skframework framework (XXIII), minimap small map tool
- np. allclose
猜你喜欢

Kotlin introductory notes (VII) data class and singleton class

Nodejs modularization

干货整理!ERP在制造业的发展趋势如何,看这一篇就够了

Understanding of smt32h7 series DMA and DMAMUX

Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning

Shutter uses overlay to realize global pop-up

LeetCode 31. 下一个排列

C form click event did not respond

Introduction Guide to stereo vision (7): stereo matching

信息與熵,你想知道的都在這裏了
随机推荐
【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
What is a firewall? Explanation of basic knowledge of firewall
Kotlin introductory notes (VIII) collection and traversal
Using request headers to develop multi terminal applications
Introduction Guide to stereo vision (1): coordinate system and camera parameters
2309. 兼具大小写的最好英文字母
Hi Fun Summer, play SQL planner with starrocks!
Blogger article navigation (classified, real-time update, permanent top)
C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
LeetCode 503. 下一个更大元素 II
Kotlin introductory notes (V) classes and objects, inheritance, constructors
基于STM32单片机的测温仪(带人脸检测)
Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
一篇文章带你走进cookie,session,Token的世界
STM32简易多级菜单(数组查表法)
Uni app implements global variables
[ManageEngine] how to make good use of the report function of OpManager
The research trend of map based comparative learning (gnn+cl) in the top paper
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
scipy.misc.imread()