element-ui分页组件修改当前页current-page后current-change事件不触发

553 阅读1分钟

​ 解决办法: current-page.sync 写入 sync 关键字

如果不写入,会导致修改当前页current-page后 ,current-change事件不触发

即当强制令页面回到第一页,this.currentPage = 1,current-change事件不触发,el-pagination的高亮渲染不变,可能还处于其他页。

<el-pagination
  :current-page.sync="currentPage"
  :page-size="20"
  layout="total, prev, pager, next"
  :total="total"
  :before-current-change="beforeCurrentChange"
  @current-change="handleCurrentChange"
></el-pagination>