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

关于a标签的target="_blank" #241

Closed
KyLeoHC opened this issue Nov 19, 2015 · 1 comment
Closed

关于a标签的target="_blank" #241

KyLeoHC opened this issue Nov 19, 2015 · 1 comment

Comments

@KyLeoHC
Copy link

KyLeoHC commented Nov 19, 2015

最近在使用vue-router的时候,由于项目下的一些需求,需要点击一个链接然后新页面打开,我测试了一下,在不用v-link的情况下,直接写href属性,a标签的target="_blank"能够正常工作,但是用v-link的话,尽管最终生成的a标签中有target属性,但是页面却不会在新页面中打开,我看了一下官方的API文档,vue-router在a标签上面绑定了click事件,在用户点击链接之后,似乎是事件调用了vue-router的go方法,并不是a标签自己默认的行为,我觉得可以考虑给v-link再给一个参数,控制是否可以新页面打开。

@WangYang-Rex
Copy link

<a target="_bank" href="https://www.jd.com/?d"> <el-button >单品查排名</el-button> </a>
我这边的问题是,第一次点击a标签会成功打开标签页,第二次点击则会刷新第一次打开的标签页,如何解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants