From 21666243e959f58f07c0ab288f0e966f8f6389b4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 4 Oct 2019 22:51:51 -0400 Subject: [PATCH] fix(compiler): props hoist should also work on elements w/ TEXT flag --- packages/compiler-core/src/transforms/hoistStatic.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/compiler-core/src/transforms/hoistStatic.ts b/packages/compiler-core/src/transforms/hoistStatic.ts index 8c6bd5b7..23b8fbd9 100644 --- a/packages/compiler-core/src/transforms/hoistStatic.ts +++ b/packages/compiler-core/src/transforms/hoistStatic.ts @@ -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