[Vuejs]-Pushing ajax data to vue component

0👍

Remove the "_" prefix from your data properties, then it should work. Vue uses underscores for internal stuff, so best avoid using it (see https://v2.vuejs.org/v2/api/#data)

0👍

There’s a problem with v-for and tables (ref ‘v-for with 2 every time’) that requires a template wrapper.

See example CodePen.

<div id='app'>
  <table>
     <template v-for="(employee, key) in employees">
       <tr>
         <td>{{ employee.first_name }}</td>
         <td>{{ employee.last_name }}</td>
       </tr>
    </template>
  <table>
</div>

It also appears that you do need to remove the underscores (try changing employee to _employee in the codepen).

Leave a comment