4π
To bind the data you just have to do a v-bind in href, and correctly target the positioning you want inside the href, continue with the example that I will provide.
<div id="app">
<a :href="icons[1].link" >test</a>
</div>
new Vue({
el: '#app',
data: () => ({
icons: [
{icon:'fab fa-facebook', link:'https://www.facebook.com/user'},
{icon:'fab fa-twitter', link:'https://twitter.com/user'},
{icon:'fab fa-linkedin', link:'https://www.linkedin.com/in/user/'},
{icon:'fab fa-instagram', link:'https://www.instagram.com/user/'},
]
})
})
π€Hamilton Gabriel
2π
You donβt have any content inside of the <a>
-tag. This should work:
<v-card-text>
<v-btn
v-for="icon in icons"
:key="icon"
class="mx-3 white--text"
icon
>
<a :href="`#${icon.link}`">
<v-icon size="24px">{{ icon.icon }}</v-icon>
</a>
</v-btn>
</v-card-text>
π€Andreas
0π
You could assign the href
property directly to the vuetify button.
<v-btn
v-for="icon in icons"
:key="icon"
class="mx-3 white--text"
icon
:href="icon.link"
>
<v-icon size="24px">{{ icon.icon }}
</v-icon>
</v-btn>
π€Jns
- [Vuejs]-If vue-resource has option like jQuery.ajaxSetup();
- [Vuejs]-Chart.js not rendering properly until window resize or toggling line in legend
Source:stackexchange.com