商家端列表页缓存

This commit is contained in:
mabo
2021-07-31 15:49:54 +08:00
parent ad17d8b743
commit 8cec0e6ab8
30 changed files with 279 additions and 493 deletions

View File

@@ -42,7 +42,7 @@
:data="data"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@@ -213,9 +213,14 @@
},
},
activated() {
mounted() {
this.init();
},
// 页面缓存处理从该页面离开时修改KeepAlive为false保证进入该页面是刷新
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss" scoped>

View File

@@ -40,7 +40,7 @@
:data="orderData"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="orderParam.pageNumber"
:total="orderTotal"
@@ -61,7 +61,7 @@
:data="refundData"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="refundParam.pageNumber"
:total="refundTotal"
@@ -82,7 +82,7 @@
:data="distributionData"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="distributionParam.pageNumber"
:total="distributionTotal"
@@ -604,6 +604,13 @@ export default {
mounted() {
this.init();
},
// 如果是从详情页返回列表页修改列表页keepAlive为true确保不刷新页面
beforeRouteLeave(to, from, next){
if(to.name === 'accountStatementBill' || to.name === 'storeBill') {
to.meta.keepAlive = true
}
next()
}
};
</script>

View File

@@ -48,7 +48,7 @@
ref="table"
class="mt_10"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@@ -179,6 +179,7 @@
},
// 分页 改变页数
changePageSize(v) {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = v;
this.getDataList();
},
@@ -218,9 +219,14 @@
},
},
activated () {
mounted () {
this.init();
},
// 页面缓存处理从该页面离开时修改KeepAlive为false保证进入该页面是刷新
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss" scoped>