vue 关于url参数拼接

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
})

你可能感兴趣的:(url拼接,uni-app,vue,vue.js)