页面缓存

This commit is contained in:
ronger 2022-10-09 09:42:21 +08:00
parent cdd6d13da0
commit 2cf1c65af6
19 changed files with 37 additions and 19 deletions

View File

@ -4,7 +4,7 @@
<header-view/>
</el-header>
<el-main>
<nuxt :nuxt-child-key="$route.name"/>
<nuxt :nuxt-child-key="$route.name" keep-alive :keep-alive-props="{max: 16}"/>
</el-main>
<el-footer height="5rem">
<footer-view/>

View File

@ -110,7 +110,8 @@ export default {
components: {
EditTags
},
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('admin/fetchArticles', params)

View File

@ -76,7 +76,8 @@ import Records from "../../components/common/bank/account/records";
export default {
name: "bank-accounts",
components: {Records},
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('bank-account/fetchList', params)

View File

@ -87,7 +87,8 @@ import {mapState} from 'vuex';
export default {
name: "banks",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('bank/fetchList', params)

View File

@ -97,7 +97,8 @@ import {mapState} from 'vuex';
export default {
name: "comments",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('admin/fetchComments', params)

View File

@ -81,7 +81,8 @@ import {mapState} from 'vuex';
export default {
name: "currency-rules",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('currency-rule/fetchList', params)

View File

@ -251,7 +251,8 @@ export default {
components: {
EditTags
},
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('dashboard/fetchDashboard', params)

View File

@ -80,7 +80,8 @@ import {mapState} from 'vuex';
export default {
name: "products",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('admin/fetchProducts', params)

View File

@ -91,7 +91,8 @@
export default {
name: "roles",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('admin/fetchRoles', params)

View File

@ -48,7 +48,8 @@
export default {
name: "tags",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('tag/fetchList', params)

View File

@ -77,7 +77,8 @@ export default {
}
return params.topic_uri
},
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store.dispatch('topic/fetchDetail', params)
.catch(err => error({statusCode: 404})),

View File

@ -39,7 +39,8 @@
export default {
name: "topics",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('topic/fetchList', params)

View File

@ -119,7 +119,8 @@ import {mapState} from 'vuex';
export default {
name: "users",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('admin/fetchUsers', params)

View File

@ -16,7 +16,8 @@
components: {
DraftList
},
fetch({store, error}) {
fetch() {
let {store, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('draft/fetchList')

View File

@ -11,7 +11,8 @@ import {mapState} from 'vuex';
export default {
name: 'Index',
fetch({store, query}) {
fetch() {
let {store, query, error} = this.$nuxt.context
return Promise.all([
store.dispatch('article/fetchList', {page: query.page || 1}),
store.dispatch('article/fetchAnnouncementList', {page: query.page || 1})

View File

@ -17,7 +17,8 @@
components: {
NotificationList
},
fetch({store, query, error}) {
fetch() {
let {store, query, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('notification/fetchList', {page: query.page || 1})

View File

@ -54,7 +54,8 @@ import gzh from "assets/rymcugzh.jpg";
Vue.prototype.$echarts = echarts;
export default {
name: "openData",
fetch({store, params, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('open-data/fetchLastThirtyDays', params)

View File

@ -16,7 +16,8 @@ import PortfolioList from "~/components/common/portfolio/list";
export default {
name: "Portfolios",
components: {PortfolioList},
fetch({store, query, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('portfolio/fetchList', {page: query.page || 1})

View File

@ -13,7 +13,8 @@ import ProductList from "~/components/common/product/list";
export default {
name: "products",
components: {ProductList},
fetch({store, query, error}) {
fetch() {
let {store, params, error} = this.$nuxt.context
return Promise.all([
store
.dispatch('product/fetchList', {page: query.page || 1})