Skip to content

Commit

Permalink
fix(componentRenderUtils): keep component root's patch flag the same …
Browse files Browse the repository at this point in the history
…as component-tag (vuejs#677)
  • Loading branch information
ysj16 committed Feb 27, 2020
1 parent e529955 commit a88c2c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/runtime-core/src/componentRenderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a88c2c8

Please sign in to comment.