首页 > 其他分享 >uni-app:页面跳转/参数的传递接收(hbuilderx 3.6.18)

uni-app:页面跳转/参数的传递接收(hbuilderx 3.6.18)

时间:2023-02-16 18:23:09浏览次数:49  
标签:option title 18 3.6 参数 跳转 com id

一,页面跳转与参数传递

            //跳转到详情页
            goItem:function(id,title) {
                uni.navigateTo({
                      url: '../item/item?id='+id+'&title='+title  
                });
            },

说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest

         对应的源码可以访问这里获取: https://github.com/liuhongdi/
         或: https://gitee.com/liuhongdi

说明:作者:刘宏缔 邮箱: [email protected]

二,参数的接收:

item.nvue

<template>
    <view>
        <text>参数:id:{{id}}</text>
        <text>参数:title:{{title}}</text>
        <button style="width:700rpx;" type="primary" @click="getItem">访问接口</button>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                id:"",
                title:"",
            }
        },
        onl oad(option) {
              this.id = option.id;
              this.title = option.title;
        },
        methods: {
        }
    }
</script>

<style>

</style>

三,测试效果

列表

 

接收到的参数

四,查看hbuilderx的版本: 

标签:option,title,18,3.6,参数,跳转,com,id
From: https://www.cnblogs.com/architectforest/p/17127823.html

相关文章