vue A页面向B页面传值,地址栏可以不进行显示的问题

参考: https://blog.csdn.net/weixin_43836052/article/details/95166345

页面A 向 页面B 进行传值,分两种情况

1.params 传参 : 相当于post请求,跳转时参数不会在地址栏中显示

            this.$router.push({
               name:'B页面名称',
               params: {id:params}
            })

            接收参数:this.$route.params.id  

2.query 传参 : 相当于get请求,页面跳转时参数会在地址栏中显示

           this.$router.push({
               name:'B页面名称',
               query: { id:params }
            })
            接收参数:this.$route.query.id

嗯,好了,就到这里了,记录工作小点滴,让模棱两可有处可寻……

原文地址:https://www.cnblogs.com/zongheng14/p/11606324.html