mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +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
|
// TODO: revert back to defineAsyncComponent when https://github.com/vuejs/core/issues/6638 is resolved
|
||||||
const LayoutLoader = defineComponent({
|
const LayoutLoader = defineComponent({
|
||||||
|
name: 'LayoutLoader',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
name: String,
|
name: String,
|
||||||
@ -42,6 +43,7 @@ const LayoutLoader = defineComponent({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
name: 'NuxtLayout',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
name: {
|
name: {
|
||||||
|
@ -2,6 +2,7 @@ import { defineComponent, h } from 'vue'
|
|||||||
import type { Component } from 'vue'
|
import type { Component } from 'vue'
|
||||||
|
|
||||||
const Fragment = defineComponent({
|
const Fragment = defineComponent({
|
||||||
|
name: 'FragmentWrapper',
|
||||||
setup (_props, { slots }) {
|
setup (_props, { slots }) {
|
||||||
return () => slots.default?.()
|
return () => slots.default?.()
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ export default defineComponent({
|
|||||||
wrapInKeepAlive(props.keepalive ?? routeProps.route.meta.keepalive ?? (defaultKeepaliveConfig as KeepAliveProps), h(Suspense, {
|
wrapInKeepAlive(props.keepalive ?? routeProps.route.meta.keepalive ?? (defaultKeepaliveConfig as KeepAliveProps), h(Suspense, {
|
||||||
onPending: () => nuxtApp.callHook('page:start', routeProps.Component),
|
onPending: () => nuxtApp.callHook('page:start', routeProps.Component),
|
||||||
onResolve: () => { nextTick(() => nuxtApp.callHook('page:finish', routeProps.Component).finally(done)) }
|
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()
|
)).default()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -84,7 +84,8 @@ function _mergeTransitionProps (routeProps: TransitionProps[]): TransitionProps
|
|||||||
return defu(..._props)
|
return defu(..._props)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Component = defineComponent({
|
const RouteProvider = defineComponent({
|
||||||
|
name: 'RouteProvider',
|
||||||
// TODO: Type props
|
// TODO: Type props
|
||||||
// eslint-disable-next-line vue/require-prop-types
|
// eslint-disable-next-line vue/require-prop-types
|
||||||
props: ['routeProps', 'pageKey', 'hasTransition'],
|
props: ['routeProps', 'pageKey', 'hasTransition'],
|
||||||
|
Loading…
Reference in New Issue
Block a user