From: edison Date: Mon, 26 Jul 2021 15:19:56 +0000 (+0800) Subject: fix(sfc/style-vars): should ignore style variable bindings in comments (#4188) X-Git-Tag: v3.2.0-beta.6~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a75d5d6942a1743789192dca9161f7c30a71e58;p=thirdparty%2Fvuejs%2Fcore.git fix(sfc/style-vars): should ignore style variable bindings in comments (#4188) fix #4185 --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap index 0c6a96a091..9616b8fdfd 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap @@ -49,6 +49,17 @@ __default__.setup = __setup__ export default __default__" `; +exports[`CSS vars injection codegen should ignore comments 1`] = ` +"export default { + setup(__props, { expose }) { + expose() +const color = 'red' +return { color } +} + +}" +`; + exports[`CSS vars injection codegen w/ \n` + + `` + ) + + expect(content).not.toMatch(`_useCssVars`) + assertCode(content) + }) + test('w/