diff --git a/packages/nuxt/src/app/components/utils.ts b/packages/nuxt/src/app/components/utils.ts index 5865558278..8fe1ec3c2c 100644 --- a/packages/nuxt/src/app/components/utils.ts +++ b/packages/nuxt/src/app/components/utils.ts @@ -1,22 +1,16 @@ -import { defineComponent, h } from 'vue' +import { h } from 'vue' import type { Component } from 'vue' // eslint-disable-next-line import { isString, isPromise, isArray } from '@vue/shared' -const Fragment = defineComponent({ - name: 'FragmentWrapper', - setup (_props, { slots }) { - return () => slots.default?.() - } -}) - /** * Internal utility * * @private */ export const _wrapIf = (component: Component, props: any, slots: any) => { - return { default: () => props ? h(component, props === true ? {} : props, slots) : h(Fragment, {}, slots) } + props = props === true ? {} : props + return { default: () => props ? h(component, props, slots) : slots.default?.() } } // eslint-disable-next-line no-use-before-define