Element: Pagination:更新total參數後,currentPage初值錯誤

Created on 17 Nov 2016  ·  1Comment  ·  Source: ElemeFE/element

異步載入資料後,更新pagination的total參數並給定current-page初值,但current-page只會是1
DEMO: jsfiddle

<div id="app">
  <p v-if="total===0">2秒後更新</p>
  <p v-else>初值錯誤,應為 {{ page }}</p>
  <el-pagination
    layout="total, prev, pager, next"
    :current-page="page"
    :page-size="size"
    :total="total">
  </el-pagination>
</div>


var vm = new Vue({
  el: '#app',
  data: {
    page: 3,
    size: 10,
    total: 0
  },
  created () {
   setTimeout(()=>this.total=50,2000)
  }
});
question

Most helpful comment

请设置 total 为 null:https://jsfiddle.net/49gptnad/58/

>All comments

请设置 total 为 null:https://jsfiddle.net/49gptnad/58/

Was this page helpful?
0 / 5 - 0 ratings