<script>
export default {
data() {
return {
};
},
// 第一种获取方式
// onLoad(e) {
// console.log(e) // {id: '15', name: 'zs'}
// }
// 第二种获取方式
onLoad() {
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let curRoute = routes[routes.length - 1].route; //获取当前页面路由
let curParam = routes[routes.length - 1].options; // 获取参数
console.log(curParam); // {id: '15', name: 'zs'}
},
};
</script>
uni-app 获取页面传参的两种方法
猜你喜欢
转载自blog.csdn.net/qq_52099965/article/details/127834182
今日推荐
周排行