mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-21 19:03:35 +08:00
Share workspace packages between Ray Admin and the interactive docs. BREAKING CHANGE: v6 is a new major line. v5 stays on legacy/v5.
48 lines
1.3 KiB
Vue
48 lines
1.3 KiB
Vue
<template>
|
|
<div class="r-route-transition">
|
|
<RouterView v-slot="{ Component, route }">
|
|
<template v-if="Component">
|
|
<Transition
|
|
:name="transitionPropName"
|
|
:mode="transitionMode"
|
|
:appear="transitionAppear"
|
|
>
|
|
<Suspense>
|
|
<KeepAlive
|
|
v-if="getKeepAliveConfig.setupKeepAlive"
|
|
:max="getKeepAliveConfig.maxKeepAliveLength"
|
|
:include="getKeepAliveInclude"
|
|
:exclude="getKeepAliveConfig.keepAliveExclude"
|
|
>
|
|
<Component :is="Component" :key="route.fullPath" />
|
|
</KeepAlive>
|
|
<Component :is="Component" v-else :key="route.fullPath" />
|
|
</Suspense>
|
|
</Transition>
|
|
</template>
|
|
</RouterView>
|
|
</div>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { RouterView } from 'vue-router'
|
|
import defaults from './transition-defaults'
|
|
import type { TransitionProps } from './transition-types'
|
|
|
|
defineOptions({
|
|
name: 'RTransitionComponent',
|
|
})
|
|
withDefaults(
|
|
defineProps<
|
|
TransitionProps & {
|
|
getKeepAliveConfig: {
|
|
setupKeepAlive: boolean
|
|
maxKeepAliveLength: number
|
|
keepAliveExclude: string[]
|
|
}
|
|
getKeepAliveInclude: string[]
|
|
}
|
|
>(),
|
|
defaults,
|
|
)
|
|
</script>
|