mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 15:41:32 +08:00
feat: routes with parameters can be cached
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { defineComponent } from 'vue';
|
||||
// import { Layout } from 'ant-design-vue';
|
||||
import { Layout } from 'ant-design-vue';
|
||||
import { RouterView } from 'vue-router';
|
||||
|
||||
// hooks
|
||||
|
||||
import { ContentEnum } from '/@/enums/appEnum';
|
||||
import { appStore } from '/@/store/modules/app';
|
||||
import PageLayout from '/@/layouts/page/index';
|
||||
// import PageLayout from '/@/layouts/page/index';
|
||||
export default defineComponent({
|
||||
name: 'DefaultLayoutContent',
|
||||
setup() {
|
||||
@@ -13,9 +15,10 @@ export default defineComponent({
|
||||
const { contentMode } = getProjectConfig;
|
||||
const wrapClass = contentMode === ContentEnum.FULL ? 'full' : 'fixed';
|
||||
return (
|
||||
// <Layout.Content class={`layout-content ${wrapClass} `}>
|
||||
<PageLayout class={`layout-content ${wrapClass} `} />
|
||||
// </Layout.Content>
|
||||
<Layout.Content class={`layout-content ${wrapClass} `}>
|
||||
{() => <RouterView />}
|
||||
{/* <PageLayout class={`layout-content ${wrapClass} `} /> */}
|
||||
</Layout.Content>
|
||||
);
|
||||
};
|
||||
},
|
||||
|
@@ -44,10 +44,10 @@ export default defineComponent({
|
||||
// TODO add key?
|
||||
const Content = openCache ? (
|
||||
<KeepAlive max={max} include={cacheTabs}>
|
||||
<Component />
|
||||
<Component key={route.path} />
|
||||
</KeepAlive>
|
||||
) : (
|
||||
<Component />
|
||||
<Component key={route.path} />
|
||||
);
|
||||
return openRouterTransition ? (
|
||||
<Transition
|
||||
|
@@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<div class="p-4">
|
||||
Current Param : {{ params }}
|
||||
<!-- <input /> -->
|
||||
<br />
|
||||
Keep Alive
|
||||
<input />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
|
Reference in New Issue
Block a user