mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 02:44:51 +00:00
18 lines
381 B
TypeScript
18 lines
381 B
TypeScript
|
import { h } from 'vue'
|
||
|
import type { Component } from 'vue'
|
||
|
|
||
|
const Fragment = {
|
||
|
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) }
|
||
|
}
|