VueJs vue-router 链接外部网站 [英] VueJs vue-router linking an external website
本文介绍了VueJs vue-router 链接外部网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这可能很简单,但我查看了文档并找不到任何相关信息.我想让我的github"链接重定向到 github.com.但是,它只是将 '
解决方案
我阅读了 Daniel 的链接并找到了解决方法:
<代码>{路径:'/github',beforeEnter() {location.href = 'http://github.com'}}
This may be simple, but I've looked over documentation and can't find anything about it. I want to have my 'github' link redirect to say, github.com. However, its just appending 'https://github.com' to my url instead of following the link. Here is a snippet:
<BreadcrumbItem to='https://github.com'>
<Icon type="social-github"></Icon>
</BreadcrumbItem>
(This is using iView for custom CSS, but 'to' works in the same way as router-link).
What ends up happening is this:
解决方案
I read Daniel's Link and found a workaround:
{
path: '/github',
beforeEnter() {location.href = 'http://github.com'}
}
这篇关于VueJs vue-router 链接外部网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文