当前位置:网站首页>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));
}
}
}
边栏推荐
- [ManageEngine] how to make good use of the report function of OpManager
- 一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
- Principle and performance analysis of lepton lossless compression
- 生成对抗网络
- Global configuration tabbar
- mysql安装配置以及创建数据库和表
- scipy.misc.imread()
- 2311. 小于等于 K 的最长二进制子序列
- Applet (use of NPM package)
- Wxml template syntax
猜你喜欢
c语言指针深入理解
Svgo v3.9.0+
Understanding rotation matrix R from the perspective of base transformation
LeetCode 496. 下一个更大元素 I
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
Global configuration tabbar
Introduction Guide to stereo vision (3): Zhang calibration method of camera calibration [ultra detailed and worthy of collection]
3D reconstruction open source code summary [keep updated]
Shutter uses overlay to realize global pop-up
What is a firewall? Explanation of basic knowledge of firewall
随机推荐
C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
Kotlin introductory notes (VII) data class and singleton class
Kotlin introductory notes (II) a brief introduction to kotlin functions
深入浅出PyTorch中的nn.CrossEntropyLoss
Ministry of transport and Ministry of Education: widely carry out water traffic safety publicity and drowning prevention safety reminders
编辑器-vi、vim的使用
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
Talking about label smoothing technology
Introduction Guide to stereo vision (7): stereo matching
基于STM32单片机的测温仪(带人脸检测)
Codeworks round 681 (Div. 2) supplement
Driver's license physical examination hospital (114-2 hang up the corresponding hospital driver physical examination)
Wxss template syntax
测试老鸟浅谈unittest和pytest的区别
Thermometer based on STM32 single chip microcomputer (with face detection)
3D reconstruction open source code summary [keep updated]
Introduction Guide to stereo vision (6): level constraints and polar correction of fusiello method
【ManageEngine】如何利用好OpManager的报表功能
Deep understanding of C language pointer