Skip to content

Commit

Permalink
feat(nuxt): expose default slot from <NuxtPage> (nuxt#27050)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini-ghost committed May 3, 2024
1 parent 589b403 commit 4779f59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/nuxt/src/pages/runtime/page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Suspense, Transition, defineComponent, h, inject, nextTick, ref, watch } from 'vue'
import { Fragment, Suspense, Transition, defineComponent, h, inject, nextTick, ref, watch } from 'vue'
import type { KeepAliveProps, TransitionProps, VNode } from 'vue'
import { RouterView } from '#vue-router'
import { defu } from 'defu'
Expand Down Expand Up @@ -37,7 +37,7 @@ export default defineComponent({
default: null,
},
},
setup (props, { attrs, expose }) {
setup (props, { attrs, slots, expose }) {
const nuxtApp = useNuxtApp()
const pageRef = ref()
const forkRoute = inject(PageRouteSymbol, null)
Expand Down Expand Up @@ -120,7 +120,7 @@ export default defineComponent({
default: () => {
const providerVNode = h(RouteProvider, {
key: key || undefined,
vnode: routeProps.Component,
vnode: slots.default ? h(Fragment, undefined, slots.default(routeProps)) : routeProps.Component,
route: routeProps.route,
renderKey: key || undefined,
trackRootNodes: hasTransition,
Expand Down

0 comments on commit 4779f59

Please sign in to comment.