uni-app带参数跳转页面
传参页面
<view class="comment" @click="comment(detail.goods_id)"><!-- 拿到要传过去的参数 -->
</view>
methods: {
comment:function(id){
uni.navigateTo({
//多个参数用&拼接:url: '../comment/comment?id='+id'&name='+name
url: '../comment/comment?id='+id
});
},
}
接受参数页面
onLoad:function(option){//opthin为object类型,会序列化上页面传递的参数
console.log(option.id);//打印出上页面传递的参数
},