I am attempting to populate a datatable with an axios call. However I am unable to actually see the data in the table on my site. If I inspect the table I can see that the data is indeed there, but not visible to the end user. Any thoughts on what I am doing wrong here?
component
<template>
<v-data-table
:items="posts"
:items-per-page="5"
item-key="post_id"
hide-default-header
class="elevation-1"
:footer-props="{
showFirstLastPage: true,
firstIcon: 'mdi-arrow-collapse-left',
lastIcon: 'mdi-arrow-collapse-right',
prevIcon: 'mdi-minus',
nextIcon: 'mdi-plus'
}"></v-data-table>
</template>
<script>
import PostService from '../services/PostService'
export default {
name: 'ViewPost',
data() {
return {
posts: []
}
},
mounted() {
this.loadPosts()
},
methods: {
loadPosts() {
this.posts = []
const posts = PostService.getAllPosts(posts).then(response => {
this.posts = response.data.recordset
})
console.log(posts)
}
}
};
</script>
</style>
console of web browser [1]: https://i.stack.imgur.com/14vI8.png
Note the paging on the bottom right of the photo... It shows 1-5 of 7 results. There are indeed 7 items in my database that are populating my posts array. So I don't feel its an issue with my axios call. You as well can see the data in the vue tab of the console with my data. Any thoughts here?