I am facing an issue with accessing the URL in my props to open them. Currently, I can only open them by right-clicking and selecting 'open in new tab,' but I want them to open when clicked. How can I correctly reference the href prop from the @click method?
<template>
<div id="app">
<div class="container">
<a :href="link.href" class="link" v-for="link in links" :key="link.href" @click="goTo">
{{ link.name }}
</a>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return{
links:[
{ name: 'Twitter', href: 'http://www.twitter.com' },
{ name: 'Github', href: 'http://www.github.com' },
]
}
},
methods: {
goTo() {
window.open();
}
}
};
</script>