uni-app 关于url参数拼接,对象形式传参、单个参数传参

let data = {
	id: item.id,
	trainId: this.id,
	type: 'news',
	ptitle: item.ptitle
};
console.log(data)
uni.navigateTo({
	url:`../details/knowDetail?data=${JSON.stringify(data)}`
});
多个参数:
let data = {
	id: this.detailData.id
}
// console.log(data)
uni.navigateTo({
url: '../knowledgeNorm/knowledgeNorm?id=' + id +'&taskId='+this.taskId,
// url: '../../../packageC/pages/index/trainIndex?peixunid='+this.result.id+'&taskId='+this.taskId+'&flow='+this.flow
})
Logo

前往低代码交流专区

更多推荐