uni-app在跳转路径时如何传参数和如何接收
直接跳转,不是根据渲染的内容进行跳转传参
const goToRedactPage = () => {
uni.navigateTo({
url: `/pagesS/components/redact/redact?userId=${userId.value}`,
});
};
渲染后,根据渲染的内容进行跳转,也就是点击谁跳转到谁的相关信息
const goToRedactchak = (item : any) => {
uni.navigateTo({
url: `/pagesS/components/clxiang/clxiang?userName=${item.userName}&realityEndTime=${item.realityEndTime}&realityStartTime=${item.realityStartTime}&userName=${item.userName}&workInfo=${item.workInfo}&planStartTime=${item.planStartTime}&planEndTime=${item.planEndTime}&workOrderId=${item.workOrderId}`,
});
};
在跳转到的页面获取传过来的内容
onLoad((options) => {
//options是传过来的所有内容
console.log("传过了的使用内容",options);
userName.value = options.userName;
workInfo.value = options.workInfo;
planStartTime.value = options.planStartTime;
planEndTime.value = options.planEndTime;
});