Commit 1c7f700c authored by janis.streib's avatar janis.streib 🦉
Browse files

ADD: dimple paginator component

parent 11aae70b
<template>
<div class="paginator">
<b-pagination :total-rows="items.length" v-model="currentPage" :per-page="items_per_page"
v-if="items && items.length > items_per_page">
</b-pagination>
<div class="pagination_container">
<slot name="content_skeleton_item" v-if="items == null || items.length == 0"></slot>
<slot name="item" v-else
v-for="item in items.slice((currentPage-1)*items_per_page, Math.min(items.length, currentPage*items_per_page))"
v-bind:item="item"/>
</div>
<b-pagination :total-rows="items.length" v-model="currentPage" :per-page="items_per_page"
v-if="items && items.length > items_per_page">
</b-pagination>
</div>
</template>
<script>
export default {
name: 'Paginator',
data() {
return {
currentPage: 1
}
},
props: {
items: {
required: true,
default() {
return null
}
},
items_per_page: {
default() {
return 25
}
}
}
}
</script>
<style scoped>
</style>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment