fix(compiler): props hoist should also work on elements w/ TEXT flag

This commit is contained in:
Evan You 2019-10-04 22:51:51 -04:00
parent 9c9ef609d8
commit 21666243e9

View File

@ -35,7 +35,11 @@ function walk(
// node may contain dynamic children, but its props may be eligible for
// hoisting.
const flag = getPatchFlag(child)
if (!flag || flag === PatchFlags.NEED_PATCH) {
if (
!flag ||
flag === PatchFlags.NEED_PATCH ||
flag === PatchFlags.TEXT
) {
let codegenNode = child.codegenNode as CallExpression
if (codegenNode.callee.includes(APPLY_DIRECTIVES)) {
codegenNode = codegenNode.arguments[0] as CallExpression