vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.95k stars 1.19k forks source link

Using the 'replace' method of VueRouter, router. replace ({path: 'url', query: {tab: 2, id:'1111 '}}), the parameters on the actual browser URL connection remain unchanged, but it can trigger the onBeforeRouteUpdate method #2369

Closed liulinana closed 2 months ago

liulinana commented 2 months ago

Reproduction

router. replace ({path: 'url', query: {tab: 2, id:'1111 '}})

Steps to reproduce the bug

初始化浏览器上的路由为/1111?tab=1 然后进行router.replace({ path: '/1111', query:{tab: 2, id: '111111111'} })进行更新url上的携带参数,实际上浏览器上的拼接参数无变化

Expected behavior

期望实际浏览器url上的参数变化成/1111?tab=2&id=111111111

Actual behavior

实际上浏览器上的拼接参数无变,仍然为就得url/1111?tab=1

Additional information

No response