feat(runtime-dom): defineCustomElement
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { Data } from '../component'
|
||||
import { Slots, RawSlots } from '../componentSlots'
|
||||
import { ContextualRenderFn } from '../componentRenderContext'
|
||||
import {
|
||||
ContextualRenderFn,
|
||||
currentRenderingInstance
|
||||
} from '../componentRenderContext'
|
||||
import { Comment, isVNode } from '../vnode'
|
||||
import {
|
||||
VNodeArrayChildren,
|
||||
@@ -11,6 +14,7 @@ import {
|
||||
} from '../vnode'
|
||||
import { PatchFlags, SlotFlags } from '@vue/shared'
|
||||
import { warn } from '../warning'
|
||||
import { createVNode } from '@vue/runtime-core'
|
||||
|
||||
/**
|
||||
* Compiler runtime helper for rendering `<slot/>`
|
||||
@@ -25,6 +29,14 @@ export function renderSlot(
|
||||
fallback?: () => VNodeArrayChildren,
|
||||
noSlotted?: boolean
|
||||
): VNode {
|
||||
if (currentRenderingInstance!.isCE) {
|
||||
return createVNode(
|
||||
'slot',
|
||||
name === 'default' ? null : { name },
|
||||
fallback && fallback()
|
||||
)
|
||||
}
|
||||
|
||||
let slot = slots[name]
|
||||
|
||||
if (__DEV__ && slot && slot.length > 1) {
|
||||
|
||||
Reference in New Issue
Block a user