fix: name -> key

This commit is contained in:
yison 2019-03-18 20:51:47 +08:00
parent 51efaf1495
commit 4d6d3e26d4

View file

@ -145,7 +145,7 @@
type: String, type: String,
default: '' default: ''
}, },
name: { key: {
type: String, type: String,
default: '' default: ''
}, },
@ -239,8 +239,8 @@
]; ];
}, },
pageSizeKey() { pageSizeKey() {
if (this.cachePageSize && this.name !== null) { if (this.cachePageSize && this.key !== null) {
return `pageSize_${this.name}`; return `pageSize_${this.key}`;
} 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.name !== null) { if (this.cachePageSize && this.key !== null) {
window.localStorage.setItem(this.pageSizeKey, pageSize); window.localStorage.setItem(this.pageSizeKey, pageSize);
} }
}, },
@ -328,7 +328,7 @@
} }
}, },
mounted () { mounted () {
if (this.cachePageSize && this.name !== null) { if (this.cachePageSize && this.key !== 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;