I got the following error:
TypeError: Cannot read property 'name' of undefined
Vue file:
<tr v-for="user in fields.data" :key="user.id">
<td>{{ user.id }}</td>
<td>{{ user.name }}</td>
<td>{{ user.email }}</td>
<td>{{ user.password }}</td>
<td>
<a href="#" data-toggle="modal" data-target="#modal" @click="edit(user.id)">
<span class="btn btn-primary">
<i class="mdi mdi-edit"></i>
</span>
</a>
</td>
</tr>
Script:
edit(id) {
this.users = this.fields[id];
console.log(this.users);
},
fields.data
? – Akhileshuser.id
? – ficuscr