From ed4c9c5cba21028212650bacc352313ef3cc901f Mon Sep 17 00:00:00 2001 From: Paul Schmidt Date: Mon, 8 May 2017 00:39:38 +0200 Subject: [PATCH] Dont overwrite currentSize of mdTablePagination (#692) * Dont overwrite currentSize of mdTablePagination with the first value from mdPageOptions. Check the value currentSize if it is in the array of options and set it, otherwise just take the (default) first option. * map props default value to local data property * allow passing the prop as a string value by parsing it as an int --- src/components/mdTable/mdTablePagination.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/mdTable/mdTablePagination.vue b/src/components/mdTable/mdTablePagination.vue index 6fcd7a8..6c7792b 100644 --- a/src/components/mdTable/mdTablePagination.vue +++ b/src/components/mdTable/mdTablePagination.vue @@ -49,7 +49,7 @@ subTotal: 0, totalItems: 0, currentPage: 1, - currentSize: 0 + currentSize: parseInt(this.mdSize, 10) }; }, watch: { @@ -108,7 +108,7 @@ this.$nextTick(() => { this.subTotal = this.currentPage * this.currentSize; this.mdPageOptions = this.mdPageOptions || [10, 25, 50, 100]; - this.currentSize = this.mdPageOptions[0]; + this.currentSize = this.mdPageOptions.includes(this.currentSize) ? this.currentSize : this.mdPageOptions[0]; this.canFireEvents = true; }); }