最近项目需要弄个Vue分页的组件,在这里分享下给大家,不多说上代码
<template>
<div class="pagination">
<div class="count">
共
<span class="red">{
{totalPage}}</span> 页
<span class="red">{
{totalElements}}</span> 条记录
</div> 
<div
class="page-button page-first"
:class="{'page-disabled':currentPage <= 1}"
@click="jump(1)"
>首页</div> 
<div
class="page-button page-prev"
:class="{'page-disabled':currentPage <= 1}"
@click="prev()"
>上一页</div> 
<div
class="page-button page-nums"
v-for="(nPage,index) in pageNumbers"
:key="index"
:class="{currentPage:nPage+pageOffset=&