I'm trying to figure out where I'm going wrong. In my VUE script below, the console log is showing my data that I expect (26 records to be exact). So I'm trying to take that data that's successfully dumping and adding to dateEvents so that I can have each record show up as a row in my HTML table. I obviously know my data is coming back in the response, but why can't I see it in my table?
<template>
<div>
<table style="width:100%; text-align:center;">
<thead>
<tr>
<!-- <th>ID</th> -->
<th>Title</th>
<th>Type</th>
<th>Available At:</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ dateEvents.name }}</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
import moment from 'moment'
export default {
name: 'hello',
data () {
return {
dateEvents: [],
config: {
defaultView: 'month',
eventRender: function(event, element) {
console.log(event)
}
},
}
},
created() {
this.fetchTasks();
},
methods: {
fetchTasks() {
axios.get('/dashboard/tasks' )
.then((response) => {
// handle success
console.log(response.data);
this.dateEvents = response.data;
})
.catch(function (error) {
// handle error
console.log(error);
})
.finally(function () {
});
}
}
}
</script>