fix: key -> cacheKey
This commit is contained in:
parent
4d6d3e26d4
commit
8a657318fc
1 changed files with 5 additions and 5 deletions
|
@ -145,7 +145,7 @@
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
key: {
|
cacheKey: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
|
@ -239,8 +239,8 @@
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
pageSizeKey() {
|
pageSizeKey() {
|
||||||
if (this.cachePageSize && this.key !== null) {
|
if (this.cachePageSize && this.cacheKey !== null) {
|
||||||
return `pageSize_${this.key}`;
|
return `pageSize_${this.cacheKey}`;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@
|
||||||
this.currentPageSize = pageSize;
|
this.currentPageSize = pageSize;
|
||||||
this.$emit('on-page-size-change', pageSize);
|
this.$emit('on-page-size-change', pageSize);
|
||||||
this.changePage(1);
|
this.changePage(1);
|
||||||
if (this.cachePageSize && this.key !== null) {
|
if (this.cachePageSize && this.cacheKey !== null) {
|
||||||
window.localStorage.setItem(this.pageSizeKey, pageSize);
|
window.localStorage.setItem(this.pageSizeKey, pageSize);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -328,7 +328,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
if (this.cachePageSize && this.key !== null) {
|
if (this.cachePageSize && this.cacheKey !== null) {
|
||||||
const pageSize = window.localStorage.getItem(this.pageSizeKey);
|
const pageSize = window.localStorage.getItem(this.pageSizeKey);
|
||||||
if (this.pageSizeOpts.includes(pageSize)) {
|
if (this.pageSizeOpts.includes(pageSize)) {
|
||||||
this.currentPageSize = pageSize;
|
this.currentPageSize = pageSize;
|
||||||
|
|
Loading…
Add table
Reference in a new issue