im using matfish-vue-table2 and im using the server side
this is my controller in laravel which i successfully get the json response via the url 'api/articles'
public function index()
{
$articles = Article::orderBy('created_at', 'desc')->paginate();
return ArticleResource::collection($articles);
}
and this is where is used the vue-table2
<template>
<div class="people">
<b-card class="mb-3">
<v-server-table :columns="columns" :options="options"></v-server-table>
</b-card>
</div>
</template>
<script>
export default {
data () {
return{
columns: ['id', 'title', 'body','created_at','updated_at'],
options: {
requestFunction: function (data) {
let vm = this;
return axios.get('api/article')
.then((response) => {this.data = response.data.data; this.count = response.data.meta.total;})
.catch(function (e) {
this.dispatch('error', e);
}.bind(this));
}
}
}
},
}
</script>
I successfully populated the table but i cant use the paginate etc, and I got the error TypeError: Cannot read property 'data' of undefined how to fix this?