From: Evan You Date: Fri, 30 Oct 2020 19:29:38 +0000 (-0400) Subject: fix: handle case of ref declaration without initial value X-Git-Tag: v3.0.3~50^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8485cd48437bf47880a61b03c57090e8bfdf527b;p=thirdparty%2Fvuejs%2Fcore.git fix: handle case of ref declaration without initial value --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 69937bc9e7..7865e20d7e 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -292,6 +292,7 @@ exports[`SFC compile `) expect(content).toMatch(`import { ref } from 'vue'`) + expect(content).not.toMatch(`ref: foo`) expect(content).not.toMatch(`ref: a`) + expect(content).not.toMatch(`ref: b`) + expect(content).toMatch(`const foo = ref()`) expect(content).toMatch(`const a = ref(1)`) expect(content).toMatch(` const b = ref({ @@ -279,6 +283,7 @@ describe('SFC compile