Parameters passed through url

1, // jump to the page page and pass a variable file

showVideo(index) {
let file = this.fastImgLists[index].id;
console.log(file);
uni.navigateTo({
url: `../page/page?file=${file}`
});
},

2, // jump to the page page and return value passed back in the past

url = "jump page? parameter name =" + parameter + "& Parameter name" parameter value +

uni.navigateTo ({

url: '../page/page?id=' + res.data.id 
+ '&name=' + res.data.name
+ '&deviceLocation=' + res.data.deviceLocation
+ '&pageFlag=' + res.data.pageFlag
+ '&device=' + res.data.device
});

Page in the page, receives the value written to the corresponding position

onLoad(obj) {
console.log(obj);
this.id = obj.id;
this.name = obj.name;
this.deviceLocation = obj.deviceLocation;
this.pageFlag = obj.pageFlag;
this.device = obj.device;
},

Guess you like

Origin www.cnblogs.com/webzzc/p/11302913.html