core
core copied to clipboard
[Bug report] 使用router进行路由跳转会丢失query参数
Description
组件中使用router进行路由跳转会丢失query参数,如下的代码所示,实际跳过去的页面后面没有query的参数,可以通过下面的复现链接点击页面中的测试按钮查看效果。不知道是从哪个版本就失效了,之前一直是有用的。
<template>
<button style="width: 200px; height: 30px" @click="testClick">测试</button>
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router';
const router = useRouter();
function testClick() {
router.push({
path: '/test',
query: {
type: '123',
},
});
}
</script>
Reproduction
https://stackblitz.com/edit/vuepress-auhtn4
Used Package Manager
pnpm
System Info
MacOS 13.5.2
Chrome 122.0.6261.112
这里路由发生了重定向,在redirectedFrom中可以拿到query
这里路由发生了重定向,在redirectedFrom中可以拿到query
可以不需要重定向吗
This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 7 days.