123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <template>
- <div class="pagination-con" v-if="total!=0">
- <a-pagination
- size="small"
- :total="total"
- :current="current"
- :pageSize="pageSize"
- show-size-changer
- :show-total="total => `共 ${total} 条记录`"
- @showSizeChange="changePageSize"
- @change="changePage" />
- </div>
- </template>
- <script>
- export default {
- name: 'TablePagination',
- props: {
- total: {
- type: [String, Number],
- default: 0
- },
- current: {
- type: [String, Number],
- default: 1
- },
- pageSize: {
- type: [String, Number],
- default: 20
- }
- },
- data () {
- return {}
- },
- methods: {
- // 分页 一页多少条change
- changePageSize (current, pageSize) {
- this.$emit('changePageSize', current, pageSize)
- },
- // 分页 页码change
- changePage (current) {
- this.$emit('changePage', current)
- }
- }
- }
- </script>
- <style lang="less">
- .pagination-con{
- text-align: right;
- margin: 10px 0;
- }
- </style>
|