James A Mohler
James A Mohler

Reputation: 11120

How do I get a data value into a link

<td>{{ page.url }}</td>
<td>
  <b-button href="#wiki/{{page.url}}" variant="primary">View</b-button>
</td>

I am trying to populate the href on my button.

I also have a router trying to do this

 <script>
 const router = new VueRouter({
     routes:[{
       path : '/:id',
       name : 'wiki',
       component : Detail
       }
     ]
 });
 </script>

Upvotes: 0

Views: 19

Answers (1)

Stephen Thomas
Stephen Thomas

Reputation: 14053

Use v-bind or the colon shortcut

<b-button :href="'#wiki/' + page.url">

Upvotes: 2

Related Questions