1

I have v-for working correctly for a url path. Now, I would like to combine the url path with the query string to the routerlink tag. The query string is the date from the v-for item. I would like to dynamically pass query string to routerlink. If this not possible, is there a way to dynamically populate the hyperlink query string using v-for?

<table v-if="loadSpinner === 'hide'" class="table table-striped text-center" style="margin-bottom: ; 100px" >
    <thead>
        <tr>
        <th scope="col">Date</th>
        <th scope="col">Total</th>
        </tr>
    </thead>
    <tbody>
        <tr v-for="item in jsonData" :key="item.date">
        <td><RouterLink to="/calendar/productList?dt={{item.date}}" >&nbsp;&nbsp;&nbsp;{{ item.date }}&nbsp;&nbsp;&nbsp;</RouterLink></td>
        <td><RouterLink to="/calendar/productList?dt={{item.date}}" >&nbsp;&nbsp;&nbsp;{{ item.total }}&nbsp;&nbsp;&nbsp;</RouterLink></td>
        </tr>
    </tbody>
</table>
amarankes
  • 95
  • 3
  • 11

1 Answers1

0

Nevermind, I needed to use v-blind method for it to read item.date

v-bind:

or

:

<RouterLink :to="'/calendar/productList?dt=' + item.date"></Routerlink>
amarankes
  • 95
  • 3
  • 11