This commit is contained in:
2026-07-21 13:20:06 +08:00
parent 76df2b9cd2
commit e50d1b8fda
21 changed files with 714 additions and 129 deletions

View File

@@ -0,0 +1,57 @@
<template>
<div v-if="isEmptyTotal" class="empty-pagination avue-crud__pagination">
<el-pagination
background
:current-page="page.currentPage"
:page-size="page.pageSize"
:page-sizes="pageSizes"
layout="total, sizes, prev, pager, next, jumper"
:total="0"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
export default {
name: 'EmptyPagination',
props: {
page: {
type: Object,
required: true,
},
},
emits: ['size-change', 'current-change', 'load'],
computed: {
isEmptyTotal() {
return Number(this.page.total || 0) === 0;
},
pageSizes() {
return this.page.pageSizes || [10, 20, 50, 100];
},
},
methods: {
handleSizeChange(pageSize) {
this.page.currentPage = 1;
this.page.pageSize = pageSize;
this.$emit('size-change', pageSize);
this.$emit('load');
},
handleCurrentChange(currentPage) {
this.page.currentPage = currentPage;
this.$emit('current-change', currentPage);
this.$emit('load');
},
},
};
</script>
<style lang="scss" scoped>
.empty-pagination {
display: flex;
justify-content: flex-end;
padding: 20px 0 0;
background: #fff;
}
</style>