Skip to content
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

希望vue-router能支持查询跳转后的地址 #2627

Closed
zhuxianbin opened this Issue Feb 27, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@zhuxianbin
Copy link

zhuxianbin commented Feb 27, 2019

What problem does this feature solve?

router 通过 与 push 一样的方式 不进行跳转而获取一个预跳转地址,与push的地址保持一致性;
可解决用于hybrid 开发模式中,A页面打开新窗口到B页面的代码书写不优雅问题;

What does the proposed API look like?

const url = this.$router.query({name:"namespace.one.two",params:{id:1001,type:"default"}})
or
const url = this.$router.push({},{prevent:true}) // Options

@posva

This comment has been minimized.

Copy link
Member

posva commented Feb 27, 2019

I tried translating but I don't understand, sorry. If you want to update the query you can push({ query: newQuery })

@posva posva closed this Feb 27, 2019

@zhuxianbin

This comment has been minimized.

Copy link
Author

zhuxianbin commented Feb 27, 2019

sorry,My English is very poor.
i think.
router.query({name:"xxx",params:{a:1}}) // router path: "/xxx/:a" , get "/xxx/1"
return me a string , example "/xxx/1"

In the process of mixed development with app, sometimes there is such a demand that a new window is opened instead of " router.push".
At this time, if you use path splicing, the code is not elegant enough. if " router" provides a method to query the path, it can ensure the correctness of the path

@posva

This comment has been minimized.

Copy link
Member

posva commented Feb 27, 2019

if you want to open a new window use a regular link. I still don't understand well what you mean... I think you should ask for help in the chinese forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.