[Vuejs]-Vue.js $.ajax() dynamic table when document ready

2👍

Use the <tr> like a list. Add a v-for="agr in agr1" then you can iterate over the properties you want. when agr1 gets updated it’ll render a new list of rows. You can also use v-bind:key="agr.property" to make it so that Vue efficiently renders the elements that get reused.

    <tbody id='table-redirect'>
        <tr 
          v-for="agr in agr1"
          v-bind:key="agr.id"
          class='lightgrey'
        >
            <td>{{ agr.name }}</td>
            <td>{{ agr.client_id }}</td>
            <td>{{ agr.url }}</td>
            <td>{{ agr.actions }}</td>
        </tr>
    </tbody>

Leave a comment