From 567440a584e7e5b5bfcf083831be24a2af0dd2ef Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Date: Thu, 22 Jun 2017 17:23:36 -0300 Subject: [PATCH] avoiding mutating prop mdPageOptions (fix #830) --- src/components/mdTable/mdTablePagination.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/mdTable/mdTablePagination.vue b/src/components/mdTable/mdTablePagination.vue index 5fa47d3..e2d12f0 100644 --- a/src/components/mdTable/mdTablePagination.vue +++ b/src/components/mdTable/mdTablePagination.vue @@ -2,7 +2,7 @@
{{ mdLabel }}: - + {{ amount }} @@ -26,7 +26,10 @@ type: [Number, String], default: 10 }, - mdPageOptions: [Array, Boolean], + mdPageOptions: { + type: [Array, Boolean], + default: () => [10, 25, 50, 100] + }, mdPage: { type: [Number, String], default: 1 @@ -110,8 +113,11 @@ }, mounted() { this.$nextTick(() => { - this.mdPageOptions = this.mdPageOptions || [10, 25, 50, 100]; - this.currentSize = this.mdPageOptions.includes(this.currentSize) ? this.currentSize : this.mdPageOptions[0]; + if (this.mdPageOptions) { + this.currentSize = this.mdPageOptions.includes(this.currentSize) ? this.currentSize : this.mdPageOptions[0]; + } else { + this.currentSize = 0; + } this.canFireEvents = true; }); }