-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Showing
26 changed files
with
167 additions
and
218 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
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 |
---|---|---|
|
@@ -76,7 +76,7 @@ | |
position: absolute; | ||
top: 0; | ||
left: 0; | ||
z-index: 1; | ||
z-index: 300; | ||
} | ||
} | ||
</style> |
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
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
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
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,45 @@ | ||
<!-- | ||
* @Description: The reason is that tsx will report warnings under multi-level nesting. | ||
--> | ||
<template> | ||
<div> | ||
<router-view> | ||
<template v-slot="{ Component, route }"> | ||
<keep-alive v-if="openCache" :include="getCaches"> | ||
<component :is="Component" :key="route.fullPath" /> | ||
</keep-alive> | ||
<component v-else :is="Component" :key="route.fullPath" /> | ||
</template> | ||
</router-view> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
import { computed, defineComponent, unref } from 'vue'; | ||
import { useRootSetting } from '/@/hooks/setting/useRootSetting'; | ||
import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; | ||
import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; | ||
import { useCache } from './useCache'; | ||
export default defineComponent({ | ||
setup() { | ||
const { getCaches } = useCache(false); | ||
const { getShowMultipleTab } = useMultipleTabSetting(); | ||
const { getOpenKeepAlive } = useRootSetting(); | ||
const { getBasicTransition, getEnableTransition } = useTransitionSetting(); | ||
const openCache = computed(() => unref(getOpenKeepAlive) && unref(getShowMultipleTab)); | ||
return { | ||
getCaches, | ||
getBasicTransition, | ||
openCache, | ||
getEnableTransition, | ||
}; | ||
}, | ||
}); | ||
</script> |
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,72 @@ | ||
import type { FunctionalComponent } from 'vue'; | ||
|
||
import { computed, defineComponent, unref, Transition, KeepAlive } from 'vue'; | ||
import { RouterView, RouteLocation } from 'vue-router'; | ||
|
||
import FrameLayout from '/@/layouts/iframe/index.vue'; | ||
|
||
import { useRootSetting } from '/@/hooks/setting/useRootSetting'; | ||
|
||
import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; | ||
import { useCache } from './useCache'; | ||
import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; | ||
|
||
interface DefaultContext { | ||
Component: FunctionalComponent; | ||
route: RouteLocation; | ||
} | ||
|
||
export default defineComponent({ | ||
name: 'PageLayout', | ||
setup() { | ||
const { getCaches } = useCache(true); | ||
const { getShowMultipleTab } = useMultipleTabSetting(); | ||
|
||
const { getOpenKeepAlive, getCanEmbedIFramePage } = useRootSetting(); | ||
|
||
const { getBasicTransition, getEnableTransition } = useTransitionSetting(); | ||
|
||
const openCache = computed(() => unref(getOpenKeepAlive) && unref(getShowMultipleTab)); | ||
|
||
return () => { | ||
return ( | ||
<> | ||
<RouterView> | ||
{{ | ||
default: ({ Component, route }: DefaultContext) => { | ||
// No longer show animations that are already in the tab | ||
const cacheTabs = unref(getCaches); | ||
const isInCache = cacheTabs.includes(route.name as string); | ||
const name = | ||
isInCache && route.meta.loaded && unref(getEnableTransition) | ||
? 'fade-slide' | ||
: null; | ||
|
||
const renderComp = () => <Component key={route.fullPath} />; | ||
|
||
const PageContent = unref(openCache) ? ( | ||
<KeepAlive>{renderComp()}</KeepAlive> | ||
) : ( | ||
renderComp() | ||
); | ||
|
||
return unref(getEnableTransition) ? ( | ||
<Transition | ||
name={name || route.meta.transitionName || unref(getBasicTransition)} | ||
mode="out-in" | ||
appear={true} | ||
> | ||
{() => PageContent} | ||
</Transition> | ||
) : ( | ||
PageContent | ||
); | ||
}, | ||
}} | ||
</RouterView> | ||
{unref(getCanEmbedIFramePage) && <FrameLayout />} | ||
</> | ||
); | ||
}; | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.