A
A
Alexey Tipa2018-04-12 22:40:55
MySQL
Alexey Tipa, 2018-04-12 22:40:55

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>

As a result, a table is shown in which the first column is empty.
Please, tell me where to add something so that the date appears?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bears, 2018-04-12
@KayzerSoze

A MySQL table has a recdate field of type DATE.

maybe there is a problem here?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question