debian-mirror-gitlab/app/assets/javascripts/vue_shared/components/pagination_links.vue

50 lines
1 KiB
Vue
Raw Normal View History

2018-12-05 23:21:45 +05:30
<script>
2019-02-15 15:39:39 +05:30
import { GlPagination } from '@gitlab/ui';
2019-09-04 21:01:54 +05:30
import {
PREV,
NEXT,
LABEL_FIRST_PAGE,
LABEL_PREV_PAGE,
LABEL_NEXT_PAGE,
LABEL_LAST_PAGE,
} from '~/vue_shared/components/pagination/constants';
2018-12-05 23:21:45 +05:30
export default {
2018-12-13 13:39:08 +05:30
components: {
GlPagination,
},
2018-12-05 23:21:45 +05:30
props: {
change: {
type: Function,
required: true,
},
pageInfo: {
type: Object,
required: true,
},
},
2019-09-04 21:01:54 +05:30
prevText: PREV,
nextText: NEXT,
labelFirstPage: LABEL_FIRST_PAGE,
labelPrevPage: LABEL_PREV_PAGE,
labelNextPage: LABEL_NEXT_PAGE,
labelLastPage: LABEL_LAST_PAGE,
2018-12-05 23:21:45 +05:30
};
</script>
<template>
<gl-pagination
v-bind="$attrs"
2019-09-04 21:01:54 +05:30
:value="pageInfo.page"
2018-12-05 23:21:45 +05:30
:per-page="pageInfo.perPage"
:total-items="pageInfo.total"
:prev-text="$options.prevText"
:next-text="$options.nextText"
2019-09-04 21:01:54 +05:30
:label-first-page="$options.labelFirstPage"
:label-prev-page="$options.labelPrevPage"
:label-next-page="$options.labelNextPage"
:label-last-page="$options.labelLastPage"
@input="change"
2018-12-05 23:21:45 +05:30
/>
</template>