<template>
      <el-row class="pages">
            <el-pagination background layout="prev, pager, next" :total="total" :page-size="limit" @change="toChange" />
      </el-row>
</template>

<script setup lang="ts">

import { defineEmits } from 'vue'

const total = defineModel('total', {
      type: Number,
      default: 0
})

const limit = defineModel('limit', {
      type: Number,
      default: 10
})


const emit = defineEmits(['search'])


/* 点击 */
const toChange = (currentPage: number) => {
      emit('search', { skip: (currentPage - 1) * limit.value })
}

</script>
<style scoped lang="scss">
.pages {
      display: flex;
      justify-content: center;
      margin: 30px 0 0 0;
}
</style>
