分頁組件實現 ,使用element 的pagination組件進行再一次封裝
https://element.eleme.io/#/zh-CN/component/pagination#
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:pag-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
使用計算屬性更改pageSize 改變時會觸發 事件size-change或者currentPage 改變時會觸發current-change
computed: {
currentPage: {
get() {
return this.page
},