StdPagination.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div v-if="Object.keys(pagination).length !== 0">
  3. <a-pagination
  4. :current="pagination.current_page"
  5. :hideOnSinglePage="true"
  6. :pageSize="pagination.per_page"
  7. :size="size"
  8. :total="pagination.total"
  9. :show-total="(total, range) => `当前显示${range[0]}-${range[1]}条数据,共${total}条数据`"
  10. class="pagination"
  11. @change="changePage"
  12. />
  13. <div class="clear"></div>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'StdPagination',
  19. props: {
  20. pagination: Object,
  21. size: {
  22. default: ''
  23. }
  24. },
  25. methods: {
  26. changePage(num) {
  27. return this.$emit('changePage', num)
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="less">
  33. .ant-pagination-total-text {
  34. @media (max-width: 450px) {
  35. display: block;
  36. }
  37. }
  38. </style>
  39. <style lang="less" scoped>
  40. .pagination {
  41. padding: 10px 0 0 0;
  42. float: right;
  43. @media (max-width: 450px) {
  44. float: unset;
  45. text-align: center;
  46. }
  47. }
  48. </style>