Vue router linking external websites
You can do smth like:
[
{stuff..., "URL":"https://www.google.com/", "external" : true},
{stuff..., "URL":"/internal-link", "external": false}
]
And then in vue component
<div class="mobile-link" v-for="link in json" :key="link.id">
<a v-if="link.external" :href="link.url">{{ link.Name }]</a>
<router-link v-else :to="link.Url">{{link.Name}}</router-link>
</div>
If you can't edit your Array directly, use map function
with regex ^(http|https)://
.
How to define the route to external link with query
There are 3 params in beforeEnter
Your code should be like this:
beforeEnter(to, from, next) {
location.href = '/path=' + to.query.path
next()
}
Programmatically redirect to URL outside the vue-router app but on the same domain?
All you need is:
window.location.href = "http://example.com";
Related Topics
How to Set the Width of Select Box Options
How to Set the Size of a Column in a Bootstrap Responsive Table
Does Height and Width Not Apply to Span
How Are the Points in CSS Specificity Calculated
How to Make Background-Size Work in Ie
How to Select an Element Based on the State of Another Element in the Page With Css
How to Vertically Center ≪Div≫ Inside the Parent Element With Css
How to Vertically Center Content With Variable Height Within a Div
Black Transparent Overlay on Image Hover With Only Css
How to Change the Symbol When Click in CSS
Spring Boot + Thymeleaf CSS Is Not Applied to Template
Is Float For Layout Bad? What Should Be Used in Its Place
What Are the Differences Between Flex-Basis and Width
Maintaining the Final State At End of a Css3 Animation
Css Force Image Resize and Keep Aspect Ratio