feat(compiler/slot): bail out of optimization mode for non-compiled slots
This commit is contained in:
@@ -6,22 +6,24 @@ import {
|
||||
Fragment,
|
||||
VNode
|
||||
} from '../vnode'
|
||||
import { PatchFlags } from '@vue/shared'
|
||||
|
||||
export function renderSlot(
|
||||
slots: Record<string, Slot>,
|
||||
key: string,
|
||||
name: string,
|
||||
props: any = {},
|
||||
// this is not a user-facing function, so the fallback is always generated by
|
||||
// the compiler and gurunteed to be an array
|
||||
fallback?: VNodeChildren
|
||||
): VNode {
|
||||
const slot = slots[key]
|
||||
const slot = slots[name]
|
||||
return (
|
||||
openBlock(),
|
||||
createBlock(
|
||||
Fragment,
|
||||
{ key: props.key },
|
||||
slot ? slot(props) : fallback || []
|
||||
slot ? slot(props) : fallback || [],
|
||||
slots._compiled ? 0 : PatchFlags.BAIL
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user