feat: 对除dashboard外的列表每页记录数进行缓存记录

This commit is contained in:
陈劲松
2020-03-13 12:20:02 +08:00
parent 0cad2d7f35
commit e0826b7cde
12 changed files with 88 additions and 13 deletions

View File

@@ -8,7 +8,7 @@
@current-change="current"
:current-page="pageObj.pageNo"
:page-sizes="pageSizes?pageSizes:[20, 50, 100]"
:page-size="20"
:page-size="pageSize"
layout="total, prev, pager, next,sizes,jumper"
:total="this.pageObj.total"
></el-pagination>
@@ -18,9 +18,11 @@
<script>
export default {
name: "pagination",
props: ['pageObj','pageSizes'],
props: ['pageObj','pageSizes', 'tableId'],
data() {
return {};
return {
pageSize: 20
};
},
methods: {
background() {
@@ -51,6 +53,14 @@ export default {
//console.info(element)
}
},
},
mounted() {
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId);
this.pageSize = pageSize ? pageSize : 20;
this.$nextTick(() => {
let input = document.querySelector(".el-pagination .el-select .el-input__inner");
input.value = this.pageSize + this.$t('pageSize');
});
}
};
</script>