refactor(runtime-core): refactor slots resolution

Get rid of need for setup proxy in production mode and improve console
inspection in dev mode
This commit is contained in:
Evan You
2020-04-06 21:06:48 -04:00
parent c5f0f63b91
commit cb504c287f
5 changed files with 151 additions and 92 deletions

View File

@@ -438,7 +438,9 @@ export function normalizeChildren(vnode: VNode, children: unknown) {
return
} else {
type = ShapeFlags.SLOTS_CHILDREN
if (!(children as RawSlots)._) {
if (!(children as RawSlots)._ && !(InternalObjectSymbol in children!)) {
// if slots are not normalized, attach context instance
// (compiled / normalized slots already have context)
;(children as RawSlots)._ctx = currentRenderingInstance
}
}