Currently, I have a component structured in the following way:
<template>
<div>
<pagination class="center" :pagination="pagination" :callback="loadData" :options="paginationOptions"></pagination>
</div>
</template>
<script>
import Pagination from 'vue-bootstrap-pagination';
export default {
components: { Pagination },
props: ['pagination', 'loadData'],
data() {
return {
paginationOptions: {
offset: 5,
previousText: 'Previous',
nextText: 'Next',
alwaysShowPrevNext: false
}
}
}
}
</script>
In another part of my project, I am utilizing the above component as follows:
<template>
<pagination :pagination="pagination" :callback="loadData" :options="paginationOptions"></pagination>
</template>
<script>
export default {
loadData() {
this.fetchItems(this.pagination.current_page);
}
//fetchItems
}
</script>
However, when implementing this, I encounter the error message:
Invalid prop: type check failed for prop "callback". Expected Function, received Undefined.
(found in component <pagination>)
Does Vue.js 2.0
not support passing a callback function?