refactor(runtime-core): tweak component proxy implementation

This commit is contained in:
Evan You
2019-12-10 11:14:29 -05:00
parent d1527fbee4
commit c97d83aff2
14 changed files with 133 additions and 64 deletions

View File

@@ -34,7 +34,8 @@ export function renderComponentRoot(
const {
type: Component,
vnode,
renderProxy,
proxy,
withProxy,
props,
slots,
attrs,
@@ -48,7 +49,7 @@ export function renderComponentRoot(
}
try {
if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
result = normalizeVNode(instance.render!.call(renderProxy))
result = normalizeVNode(instance.render!.call(withProxy || proxy))
} else {
// functional
const render = Component as FunctionalComponent