vue A to page B page by value, the address bar can not be displayed question

Reference: https://blog.csdn.net/weixin_43836052/article/details/95166345

A value to be transmitted page page B, two cases

1.params parameter passing: the equivalent post request, the parameter is not displayed in the address bar when jumping

    ``` html  

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

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

     ``` html
         

2.query parameter passing: the equivalent of get request parameters will be displayed in the address bar of the page jump

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

     ``` html

Guess you like

Origin www.cnblogs.com/zongheng14/p/11606324.html