Skip to content

Commit b380dcf

Browse files
praneetlokemarcosmoura
authored andcommitted
refactor property names to make more sense vuematerial#517 (vuematerial#521)
* 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 vuematerial#482. * Improve code readability for the fix done for vuematerial#482.
1 parent cde4710 commit b380dcf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/mdTable/mdTablePagination.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<md-icon>keyboard_arrow_left</md-icon>
1313
</md-button>
1414

15-
<md-button class="md-icon-button md-table-pagination-next" @click.native="nextPage" :disabled="hasMoreItems">
15+
<md-button class="md-icon-button md-table-pagination-next" @click.native="nextPage" :disabled="shouldDisable">
1616
<md-icon>keyboard_arrow_right</md-icon>
1717
</md-button>
1818
</div>
@@ -56,17 +56,17 @@
5656
this.totalItems = isNaN(val) ? Number.MAX_SAFE_INTEGER : parseInt(val, 10);
5757
},
5858
mdSize(val) {
59-
this.currentSize = parseInt(this.mdSize, 10);
59+
this.currentSize = parseInt(val, 10);
6060
},
6161
mdPage(val) {
62-
this.currentPage = parseInt(this.mdPage, 10);
62+
this.currentPage = parseInt(val, 10);
6363
}
6464
},
6565
computed: {
6666
lastPage() {
6767
return false;
6868
},
69-
hasMoreItems() {
69+
shouldDisable() {
7070
return this.currentSize * this.currentPage >= this.totalItems;
7171
}
7272
},

0 commit comments

Comments
 (0)