New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

跳转到新页面通过params传参,取不到参数值 #2572

Closed
zbjy opened this Issue Jan 8, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@zbjy
Copy link

zbjy commented Jan 8, 2019

Version

3.0.1

Reproduction link

https://codesandbox.io/s/pwjrx9r6lm

Steps to reproduce

const {href} = this.$router.resolve({
name: "test",
params: {
id:2
}
});
window.open(href, '_blank');
在新页面获取不到参数id的值
let params = this.$route.params;
alert(params.id)

What is expected?

期望在新页面能取到通过params传递的参数值

What is actually happening?

在新页面未能取到通过params传递的参数值

@posva

This comment has been minimized.

Copy link
Member

posva commented Jan 8, 2019

make sure to declare params in the path


Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂

@posva posva closed this Jan 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment