1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-01-22 23:50:22 +08:00

2 Commits

Author SHA1 Message Date
Nexpro
95f72c7f3a Merge 07754975da into db800f60a9 2024-09-26 17:27:40 +08:00
Nexpro
07754975da Add pagination size picker 2024-09-18 17:30:09 +08:00

View File

@@ -69,6 +69,13 @@ const props = defineProps({
isPagination: { isPagination: {
type: Boolean, type: Boolean,
default: true, default: true,
},
/**
* @isShowSizePicker 是否显示每页条数选择
*/
isShowSizePicker: {
type: Boolean,
default: false,
}, },
scrollX: { scrollX: {
type: Number, type: Number,
@@ -116,6 +123,16 @@ const pagination = reactive({
prefix({ itemCount }) { prefix({ itemCount }) {
return `${itemCount} 条数据` return `${itemCount} 条数据`
}, },
pageSizes: [10, 20, 50, 100],
showSizePicker: props.isShowSizePicker,
onChange: (page) => {
pagination.page = page
},
onUpdatePageSize: (pageSize) => {
pagination.pageSize = pageSize
pagination.page = 1
handleQuery()
},
}) })
// 是否展开 // 是否展开