Answer the question
In order to leave comments, you need to log in
How to write code to dynamically change the data in the table?
The data comes from the server in the form of an array of objects from which the table is formed. When the first data
arrives, the table is formed correctly. But the code does not react to subsequent data (the template is not redrawn). Can you help me figure out how to code correctly?
<table id="table-box">
<tr v-for="item in items">
<td class="column">{{item.date}}</td>
<td class="column">{{item.regs}}</td>
<td class="column">{{item.first_deposits}}</td>
<td class="column">{{item.deposits}}</td>
</tr>
</table>
$.ajax({
type: 'post',
url: '/api/v1/user',
data: formData,
success: function (data) {
new Vue({
el:'#table-box',
data:{
items: data
}
});
},
error: function (xhr, status, error) {
}
});
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