Skip to content

Instantly share code, notes, and snippets.

@onlyurei
Created December 4, 2017 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onlyurei/480c75e47344f685021bc80f239c9059 to your computer and use it in GitHub Desktop.
Save onlyurei/480c75e47344f685021bc80f239c9059 to your computer and use it in GitHub Desktop.
<template>
<div v-if="length > 1" class="text-xs-center mt-5">
<v-pagination v-bind="{ length, totalVisible: totalVisibleResponsive, circle }"
v-model="page"/>
</div>
</template>
<script>
import { pagination, params } from '~/utils/mixins/pagination'
const { limit, maxOffset } = params
export default {
mixins: [pagination],
props: {
limit: { type: Number, default: limit },
maxOffset: { type: Number, default: maxOffset },
totalVisible: { type: Number, default: 9 },
circle: { type: Boolean, default: false }
},
computed: {
totalVisibleResponsive() {
const breakpoint = this.$vuetify.breakpoint
if (breakpoint.mdAndUp) return this.totalVisible
if (breakpoint.sm) return 7
if (breakpoint.xs) return 5
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment