mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): name anonymous components in render tree (#10011)
This commit is contained in:
parent
488479ab1b
commit
0db3c6373a
@ -12,6 +12,7 @@ import { appLayoutTransition as defaultLayoutTransition } from '#build/nuxt.conf
|
||||
|
||||
// TODO: revert back to defineAsyncComponent when https://github.com/vuejs/core/issues/6638 is resolved
|
||||
const LayoutLoader = defineComponent({
|
||||
name: 'LayoutLoader',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
name: String,
|
||||
@ -42,6 +43,7 @@ const LayoutLoader = defineComponent({
|
||||
}
|
||||
})
|
||||
export default defineComponent({
|
||||
name: 'NuxtLayout',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
name: {
|
||||
|
@ -2,6 +2,7 @@ import { defineComponent, h } from 'vue'
|
||||
import type { Component } from 'vue'
|
||||
|
||||
const Fragment = defineComponent({
|
||||
name: 'FragmentWrapper',
|
||||
setup (_props, { slots }) {
|
||||
return () => slots.default?.()
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ export default defineComponent({
|
||||
wrapInKeepAlive(props.keepalive ?? routeProps.route.meta.keepalive ?? (defaultKeepaliveConfig as KeepAliveProps), h(Suspense, {
|
||||
onPending: () => nuxtApp.callHook('page:start', routeProps.Component),
|
||||
onResolve: () => { nextTick(() => nuxtApp.callHook('page:finish', routeProps.Component).finally(done)) }
|
||||
}, { default: () => h(Component, { key, routeProps, pageKey: key, hasTransition } as {}) })
|
||||
}, { default: () => h(RouteProvider, { key, routeProps, pageKey: key, hasTransition } as {}) })
|
||||
)).default()
|
||||
}
|
||||
})
|
||||
@ -84,7 +84,8 @@ function _mergeTransitionProps (routeProps: TransitionProps[]): TransitionProps
|
||||
return defu(..._props)
|
||||
}
|
||||
|
||||
const Component = defineComponent({
|
||||
const RouteProvider = defineComponent({
|
||||
name: 'RouteProvider',
|
||||
// TODO: Type props
|
||||
// eslint-disable-next-line vue/require-prop-types
|
||||
props: ['routeProps', 'pageKey', 'hasTransition'],
|
||||
|
Loading…
Reference in New Issue
Block a user