Using vuejs 2.5 if there is a way in router-link to set
target= '_blank'
? I tried this way:
<router-link :to="{name: 'UserProfileView', params: {id: participantUser.user_id}, target: '_blank' }" >
but failed...
Thanks!
Using vuejs 2.5 if there is a way in router-link to set
target= '_blank'
? I tried this way:
<router-link :to="{name: 'UserProfileView', params: {id: participantUser.user_id}, target: '_blank' }" >
but failed...
Thanks!
You will add target='_blank'
like on <a>
tag
Hope is clear
<router-link :to="{name: 'UserProfileView', params: {id: participantUser.user_id}}" target= '_blank' >
–
Concinnate <router-link target= '_blank' >my link </router-link>
–
Concinnate You must to use method. Method looks something like this:
methods: {
redirectToUserView(user) {
const route = this.$router.resolve({
name: 'UserProfileView',
params: {id: participantUser.user_id},
});
window.open(route.href, '_blank');
},
}
Below code is to open a new tab with parameter.
With router link=
<router-link
:to="{ name: 'task_section',query: {reportId: item.task,}}"
target="_blank"> Link Text
</router-link>
Now access to the sented data
this.$route.query.reportId
Perfectly worked for my code "target='_blank'
" with external redirect.
<b-dropdown-item
:key="props.row.banner_id"
:to="{name:'banners-preview',
params: { id: props.row.banner_id } }"
target='_blank'
>
<feather-icon
icon="ExternalLinkIcon"
class="mr-50"
/>
<span>Preview Link</span>
</b-dropdown-item>
try this :
<template>
<div id="app">
<button @click="gotoContact()">Contact</button>
</div>
</template>
<script>
export default {
name: "app",
methods: {
gotoContact() {
let route = this.$router.resolve({ path: "/contact" });
window.open(route.href);
},
},
};
</script>
© 2022 - 2024 — McMap. All rights reserved.