From a88c2c8a23b6a63d4ecfa406ec7c0cf48bf3ae7b Mon Sep 17 00:00:00 2001 From: yushangjiang <504427021@qq.com> Date: Thu, 27 Feb 2020 21:37:57 +0800 Subject: [PATCH] fix(componentRenderUtils): keep component root's patch flag the same as component-tag (#677) --- packages/runtime-core/src/componentRenderUtils.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/runtime-core/src/componentRenderUtils.ts b/packages/runtime-core/src/componentRenderUtils.ts index b7646d72a8b..8738da5660f 100644 --- a/packages/runtime-core/src/componentRenderUtils.ts +++ b/packages/runtime-core/src/componentRenderUtils.ts @@ -64,6 +64,13 @@ export function renderComponentRoot( result = normalizeVNode( instance.render!.call(proxyToUse, proxyToUse, renderCache) ) + // root node should inherit class/style in component tag and patch + if (vnode.patchFlag & PatchFlags.CLASS) { + result.patchFlag |= PatchFlags.CLASS + } + if (vnode.patchFlag & PatchFlags.STYLE) { + result.patchFlag |= PatchFlags.STYLE + } } else { // functional const render = Component as FunctionalComponent