mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-28 08:28:18 +00:00
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
This commit is contained in:
parent
8042caef99
commit
ed4c9c5cba
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue