mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-22 05:51:52 +00:00
* Added watchers on mdTotal and mdPage. Changed the binding for the disabled attribute of the next page arrow to use a computed property. Fix issue #482. * Improve code readability for the fix done for #482.
This commit is contained in:
parent
cde4710cf0
commit
b380dcfca6
1 changed files with 4 additions and 4 deletions
|
|
@ -12,7 +12,7 @@
|
|||
<md-icon>keyboard_arrow_left</md-icon>
|
||||
</md-button>
|
||||
|
||||
<md-button class="md-icon-button md-table-pagination-next" @click.native="nextPage" :disabled="hasMoreItems">
|
||||
<md-button class="md-icon-button md-table-pagination-next" @click.native="nextPage" :disabled="shouldDisable">
|
||||
<md-icon>keyboard_arrow_right</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
|
|
@ -56,17 +56,17 @@
|
|||
this.totalItems = isNaN(val) ? Number.MAX_SAFE_INTEGER : parseInt(val, 10);
|
||||
},
|
||||
mdSize(val) {
|
||||
this.currentSize = parseInt(this.mdSize, 10);
|
||||
this.currentSize = parseInt(val, 10);
|
||||
},
|
||||
mdPage(val) {
|
||||
this.currentPage = parseInt(this.mdPage, 10);
|
||||
this.currentPage = parseInt(val, 10);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
lastPage() {
|
||||
return false;
|
||||
},
|
||||
hasMoreItems() {
|
||||
shouldDisable() {
|
||||
return this.currentSize * this.currentPage >= this.totalItems;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue