A strange problem of vue changing query parameters

the current route, such as / search , I want to jump to / search?p=1 . The first thought on the home page is to read this.$route.query , and then modify p to achieve the jump,
but the following push methods in my project do not jump to the url I thought of

.
let newQuery = this.$route.query //query
newQuery.p   = val //

let routeParam={
    query: newQuery
}

this.$router.push(routeParam)

I think the above problem may be that I don"t know about vue-router , so I don"t know what"s wrong, but the strange thing is that the following code successfully jumps to the url, I want. I print out routeParam to see if there"s any difference

.
let newQuery = {}
newQuery.p   = val
let routeParam={
    query: newQuery
}
this.$router.push(routeParam)

in fact, I want to change more than just the p parameter, so I read this.$route.query every time, and then modify
, but I don"t understand the problem above, am I missing any details?


if you look at the code, it should be a matter of value and address.

            let newQuery = JSON.parse(JSON.stringify(this.$route.query)); //query
            newQuery.p = val
            let routeParam={
                query: newQuery
            }
            this.$router.push(routeParam)

see a similar problem vue routing request parameters changed

this.$route.query is an addressing call?


this.$router.push({path:'/index/detail',query:{id:xx,num:xxx}});
query
path 
?
Menu