ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

How to go to the specific page? #19

Closed TonyChenWin closed 7 years ago

TonyChenWin commented 7 years ago

I test these code: Vue.nextTick(() => this.vuetable.changePage(4)); Nothing is sent.

so I test these code: Vue.nextTick(() => this.vuetable.changePage(4)); this.$refs.vuetable.refresh(); It will request twice.One is page 1,the other is page 4. The result is sometimes it will go to page 1,and sometimes it will goto page 4.

How to goto the specific page?

ratiw commented 7 years ago

@TonyChenWin You should use this.$refs.vuetable.changePage(4) instead of this.vuetable.changePage(4) the same way you call this.$refs.vuetable.refresh()

TonyChenWin commented 7 years ago

thanks,@ratiw I had found my problem ! When the page is 4,I can't use changePage(4) or gotoPage(4) to refresh the table. I should use the funciont reload().

because in the source code, changePage(4) or gotoPage(4) have a condition : page != this.currentPage.