-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f2d91f
commit fd0b825
Showing
5 changed files
with
37 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script setup lang="ts"> | ||
import { ParentCompConsumer } from '@/layouts/basic-layout/parent-comp-consumer' | ||
defineOptions({ | ||
name: 'CustomRouteView', | ||
}) | ||
const appStore = useAppStore() | ||
const { layoutSetting } = storeToRefs(appStore) | ||
const multiTabStore = useMultiTab() | ||
const { cacheList } = storeToRefs(multiTabStore) | ||
const { getComp } = useCompConsumer() | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-col h-full"> | ||
<ParentCompConsumer> | ||
<RouterView> | ||
<template #default="{ Component, route }"> | ||
<Transition appear :name="layoutSetting.animationName" mode="out-in"> | ||
<KeepAlive v-if="layoutSetting.keepAlive" :include="[...cacheList]"> | ||
<component :is="getComp(Component)" :key="route.fullPath" /> | ||
</KeepAlive> | ||
<component :is="Component" v-else :key="route.fullPath" /> | ||
</Transition> | ||
</template> | ||
</RouterView> | ||
</ParentCompConsumer> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,9 @@ | ||
<script setup lang="ts"> | ||
import { ParentCompConsumer } from '@/layouts/basic-layout/parent-comp-consumer' | ||
defineOptions({ | ||
name: 'CustomRouteView', | ||
name: 'RouteView', | ||
}) | ||
const appStore = useAppStore() | ||
const { layoutSetting } = storeToRefs(appStore) | ||
const multiTabStore = useMultiTab() | ||
const { cacheList } = storeToRefs(multiTabStore) | ||
const { getComp } = useCompConsumer() | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-col h-full"> | ||
<ParentCompConsumer> | ||
<RouterView> | ||
<template #default="{ Component, route }"> | ||
<Transition appear :name="layoutSetting.animationName" mode="out-in"> | ||
<KeepAlive v-if="layoutSetting.keepAlive" :include="[...cacheList]"> | ||
<component :is="getComp(Component)" :key="route.fullPath" /> | ||
</KeepAlive> | ||
<component :is="Component" v-else :key="route.fullPath" /> | ||
</Transition> | ||
</template> | ||
</RouterView> | ||
</ParentCompConsumer> | ||
</div> | ||
<RouterView /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters