]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler): props hoist should also work on elements w/ TEXT flag
authorEvan You <yyx990803@gmail.com>
Sat, 5 Oct 2019 02:51:51 +0000 (22:51 -0400)
committerEvan You <yyx990803@gmail.com>
Sat, 5 Oct 2019 02:51:51 +0000 (22:51 -0400)
packages/compiler-core/src/transforms/hoistStatic.ts

index 8c6bd5b7f8465f6c7faa3b10d958ef7eb04ec052..23b8fbd944a3eb984c4377dfc89444d1c5107b50 100644 (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