Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a link inside vue bootstrap b-table cell [duplicate]

I have a b-table compo

<b-table responsive 
         hover 
         :items="myItems" 
         :fields="myField">

On my items, I return a url from the back-end, so I want to do on my template

<template slot="my-link" slot-scope="data">
    <a href="data.item.link">link</a>
 </template>

The above doesn't work, it renders

<a href="data.item.link">link</a>

Instead of

<a href="https://mylink.com">link</a>
like image 336
Petran Avatar asked Mar 21 '26 00:03

Petran


1 Answers

You should bind it using v-bind:href="..." or shortly :href="..." with b-link component :

 <template slot="my-link" slot-scope="data">
    <b-link :href="data.item.link">link</b-link>
</template>
like image 84
Boussadjra Brahim Avatar answered Mar 24 '26 10:03

Boussadjra Brahim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!