Answer the question
In order to leave comments, you need to log in
How to pass date from JSON to v-for vue.js?
A MySQL table has a recdate field of type DATE.
The lines in this field store the date in this format "yyyy-mm-dd"
I make a query to the table, and pass the resulting array to v-for to display the rows in the table in HTML
Everything reads fine, only the date is not displayed from the word " at all".
Example:
<table class="table table-bordered table-striped">
<thead>
<th>Date</th>
<th>Refnum</th>
<th>Client</th>
<th>Details</th>
<th>Amount</th>
<th>CUR</th>
</thead>
<tbody>
<tr v-for="tran in trans">
<td>{{ tran.recdate }} </td>
<td>{{ tran.refnum }}</td>
<td>{{ tran.client }}</td>
<td>{{ tran.details }}</td>
<td>{{ tran.amount }}</td>
<td>{{ tran.cur }}</td>
</tr>
</tbody>
</table>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question