uni-app:获取url路径中的数组参数(onshow中获取)
uni-app:获取url路径中的数组参数(onshow中获取)
·
A页面
select_stockid() {
const selectedListOld = JSON.stringify(this.list_stockid);
const encodedParam = encodeURIComponent(selectedListOld);
uni.navigateTo({
url: `../select_stockid/select_stockid?selectedList_old=${encodedParam}`
})
},
B页面
onShow() {
let pages = getCurrentPages();
let currentPage = pages[pages.length - 1];
let options = currentPage.options;
if (options.selectedList_old) {
let selectedListOld = JSON.parse(options.selectedList_old);
console.log(selectedListOld); // 输出传递的数组参数
}
},
更多推荐
已为社区贡献13条内容
所有评论(0)