]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-dom): style transform of static styles should not add STYLE patchFlag
authorEvan You <yyx990803@gmail.com>
Wed, 23 Oct 2019 14:49:16 +0000 (10:49 -0400)
committerEvan You <yyx990803@gmail.com>
Wed, 23 Oct 2019 14:49:16 +0000 (10:49 -0400)
packages/compiler-core/src/transform.ts
packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts

index dd979d23583c454fd4450ca017c5d205094bfcf3..fe717905cef681d8a3e62c4a3a1e0b0849a7b8a5 100644 (file)
@@ -215,7 +215,8 @@ function createTransformContext(
       return createSimpleExpression(
         `_hoisted_${context.hoists.length}`,
         false,
-        exp.loc
+        exp.loc,
+        true
       )
     },
     cache(exp) {
index 87aa7f958f7665d2098b4d261389188db4bd0ec7..5c568c2719fbe672b6d68c45a532f3ac3bc2ad90 100644 (file)
@@ -77,5 +77,7 @@ describe('compiler: style transform', () => {
         }
       ]
     })
+    // should not cause the STYLE patchFlag to be attached
+    expect((node.codegenNode as CallExpression).arguments.length).toBe(2)
   })
 })