element-ui 分页修改current-page后,视图上还是没改变

方法一

1.将官网上的分页current-page="currentPage4" 改成   :current-page.sync="currentPage4"

2.搜索时 this.currentPage4 = 1

方法二 

data里面初始化paginationShow为true

@current-change="handleCurrentChange"

:current-page.sync="pagination.currentPage"

:page-size="pagination.size"

layout="total, prev, pager, next, jumper"

:total="pagination.total">


search () {

this.paginationShow = false

this.handleCurrentChange(1)

this.$nextTick(function () {

this.paginationShow = true;

})

},

简单来说就是将其组件强制重置为首页在重新渲染 ,方法可行但略显笨重

你可能感兴趣的:(element-ui 分页修改current-page后,视图上还是没改变)