写一个表格,通过分页功能将内容完全展示出来

简单来说就是:前端分页~
参考自 https://blog.csdn.net/weixin_44313369/article/details/100579078

HTML:

 <el-tab-pane label="最新信息" name="first" style="padding: 5px 15px 5px;" >
            <el-table :data="newInfo.slice((currPage-1)*pageSize, currPage*pageSize)" style="width: 100%;">
              <el-table-column prop="time" width='120' label="时间"></el-table-column>
              <el-table-column prop="type" label="任务类型" fit></el-table-column>
              <el-table-column prop="msgFrom" label="发送方" fit></el-table-column>
              <el-table-column prop="msgReceive" label="接受方" fit></el-table-column>
              <el-table-column prop="status" label="任务状态" fit></el-table-column>
            </el-table>
             <div class="block" style="margin-top: 5px; margin-bottom: 5px;" >
           <el-pagination  layout="prev, pager, next"  
           :current-page.sync="currPage" 
           :page-size=pageSize 
           @size-change="handleSizeChange"
            @current-change="handleCurrentChange" 
            :total="36" style="text-align: center;"> </el-pagination>
       </div>
          </el-tab-pane>

JS:

return{
        currPage:1,
        pageSize:2,
        newInfo: [
       {time:'第一页',
          type:'000',
          msgFrom:'11',
          msgReceive:'1111',
          status:'111'
      },
       {time:'000',
          type:'000',
          msgFrom:'11',
          msgReceive:'1111',
          status:'111'
      },
       {time:'第二页',
          type:'000',
          msgFrom:'11',
          msgReceive:'1111',
          status:'111'
      },
       {time:'000',
          type:'000',
          msgFrom:'11',
          msgReceive:'1111',
          status:'111'
      }]
        }
methods:{
    handleSizeChange(val) {
        this.pageSize = val;
        this.currPage = 1;
      },
    handleCurrentChange(val) {
       this.currPage = val;
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值