1- import { computed , defineComponent , h , inject , provide , reactive , onMounted , nextTick , Suspense , Transition } from 'vue'
1+ import { computed , defineComponent , h , inject , provide , reactive , onMounted , nextTick , Suspense , Transition , KeepAliveProps , TransitionProps } from 'vue'
22import type { DefineComponent , VNode } from 'vue'
33import { RouteLocationNormalized , RouteLocationNormalizedLoaded , RouterView } from 'vue-router'
44import type { RouteLocation } from 'vue-router'
@@ -18,6 +18,14 @@ export default defineComponent({
1818 name : {
1919 type : String
2020 } ,
21+ transition : {
22+ type : [ Boolean , Object ] as any as ( ) => boolean | TransitionProps ,
23+ default : undefined
24+ } ,
25+ keepalive : {
26+ type : [ Boolean , Object ] as any as ( ) => boolean | KeepAliveProps ,
27+ default : undefined
28+ } ,
2129 route : {
2230 type : Object as ( ) => RouteLocationNormalized
2331 } ,
@@ -38,10 +46,10 @@ export default defineComponent({
3846 if ( ! routeProps . Component ) { return }
3947
4048 const key = generateRouteKey ( props . pageKey , routeProps )
41- const transitionProps = routeProps . route . meta . pageTransition ?? defaultPageTransition
49+ const transitionProps = props . transition ?? routeProps . route . meta . pageTransition ?? ( defaultPageTransition as TransitionProps )
4250
4351 return _wrapIf ( Transition , transitionProps ,
44- wrapInKeepAlive ( routeProps . route . meta . keepalive ?? defaultKeepaliveConfig , isNested && nuxtApp . isHydrating
52+ wrapInKeepAlive ( props . keepalive ?? routeProps . route . meta . keepalive ?? ( defaultKeepaliveConfig as KeepAliveProps ) , isNested && nuxtApp . isHydrating
4553 // Include route children in parent suspense
4654 ? h ( Component , { key, routeProps, pageKey : key , hasTransition : ! ! transitionProps } as { } )
4755 : h ( Suspense , {
0 commit comments