From: Evan You Date: Fri, 28 May 2021 22:40:35 +0000 (-0400) Subject: fix(compiler-sfc): fix style injection when using normal script + setup X-Git-Tag: v3.1.0-beta.7~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b94464a3b9759a7a98c23efeafc7a9359c9807d;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): fix style injection when using normal script + setup fix #3688 --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap index a2926e8fee..99f963804b 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap @@ -109,3 +109,26 @@ return { color, size, ref } }" `; + +exports[`CSS vars injection w/ normal \n` + + `` + ) + expect(content).toMatch(`_useCssVars(_ctx => ({ + "${mockId}-size": (_ctx.size) +})`) + expect(content).toMatch(`import { useCssVars as _useCssVars } from 'vue'`) + assertCode(content) + }) + test('w/