当前位置:网站首页>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));
}
}
}
边栏推荐
- Principle and performance analysis of lepton lossless compression
- scipy. misc. imread()
- Greendao reported an error in qigsaw, could not init daoconfig
- Summary and Reflection on issues related to seq2seq, attention and transformer in hands-on deep learning
- MYSQL 对字符串类型排序不生效问题
- Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning
- Wxss template syntax
- Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
- 阿里云发送短信验证码
- 顶会论文看图对比学习(GNN+CL)研究趋势
猜你喜欢
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
OpenGL - Coordinate Systems
Rebuild my 3D world [open source] [serialization-2]
Using request headers to develop multi terminal applications
【阅读笔记】图对比学习 GNN+CL
[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b
Blogger article navigation (classified, real-time update, permanent top)
Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning
信息与熵,你想知道的都在这里了
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
随机推荐
Codeforces round 684 (Div. 2) e - green shopping (line segment tree)
阿里云发送短信验证码
Introduction Guide to stereo vision (3): Zhang calibration method of camera calibration [ultra detailed and worthy of collection]
Applet data attribute method
Composition of applet code
Kotlin introductory notes (VIII) collection and traversal
一次 Keepalived 高可用的事故,让我重学了一遍它
Editor use of VI and VIM
驾驶证体检医院(114---2 挂对应的医院司机体检)
Unity SKFramework框架(二十二)、Runtime Console 运行时调试工具
Priority queue (heap)
[technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
Codeworks round 681 (Div. 2) supplement
Nodemon installation and use
Kotlin introductory notes (II) a brief introduction to kotlin functions
Unity skframework framework (XXII), runtime console runtime debugging tool
Alibaba cloud sends SMS verification code
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
STM32简易多级菜单(数组查表法)