gaoluyang
2025-05-26 50478b84da86ef020c2fcb6de2855644a95fee10
src/components/Pagination/index.vue
@@ -59,7 +59,7 @@
  }
})
const emit = defineEmits();
const emit = defineEmits()
const currentPage = computed({
  get() {
    return props.page
@@ -76,25 +76,28 @@
    emit('update:limit', val)
  }
})
function handleSizeChange(val) {
  if (currentPage.value * val > props.total) {
    currentPage.value = 1
  }
  emit('pagination', { page: currentPage.value, limit: val })
  if (props.autoScroll) {
    scrollTo(0, 800)
  }
}
function handleCurrentChange(val) {
  emit('pagination', { page: val, limit: pageSize.value })
  if (props.autoScroll) {
    scrollTo(0, 800)
  }
}
</script>
<style scoped>
.pagination-container {
  background: #fff;
  padding: 32px 16px;
}
.pagination-container.hidden {
  display: none;