zl程序教程

您现在的位置是:首页 >  其它

当前栏目

uni——跳转传参(单个参数、多个参数)

参数 多个 跳转 uni 单个 传参
2023-09-14 09:04:08 时间

简介

跳转传参以及接收参数

list.vue文件(传)

1.单个参数
toDetails(item,index) {
	this.$common.to(`pages/index/details?id=${item.id}`)
},
或者
toDetails(item,index) {
	this.$common.to('/pages/index/details?id=' + item.id);
},
2.多个参数
toDetails(item,index) {
	this.$common.to(`pages/index/details?id=${item.id}&type=${item.type}`)
},
或者
toDetails(item,index) {
	this.$common.to('/pages/index/details?id=' + item.id + '&type=' + item.type);
},

detalis.vue文件(接收)

onload(options){
  console.log(options)
}