mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
fix(nuxt): remove internal <FragmentWrapper>
(#20607)
This commit is contained in:
parent
c9c51cb3d8
commit
2c55bb6f84
@ -1,22 +1,16 @@
|
|||||||
import { defineComponent, h } from 'vue'
|
import { h } from 'vue'
|
||||||
import type { Component } from 'vue'
|
import type { Component } from 'vue'
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
import { isString, isPromise, isArray } from '@vue/shared'
|
import { isString, isPromise, isArray } from '@vue/shared'
|
||||||
|
|
||||||
const Fragment = defineComponent({
|
|
||||||
name: 'FragmentWrapper',
|
|
||||||
setup (_props, { slots }) {
|
|
||||||
return () => slots.default?.()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal utility
|
* Internal utility
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export const _wrapIf = (component: Component, props: any, slots: any) => {
|
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
|
// eslint-disable-next-line no-use-before-define
|
||||||
|
Loading…
Reference in New Issue
Block a user