From f66d456b7a39db9dae7e70c28bb431ff293d8fef Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 8 Oct 2021 23:57:39 +0800 Subject: [PATCH] fix(compiler-sfc): support runtime Enum in normal script (#4698) --- .../__snapshots__/compileScript.spec.ts.snap | 19 ++++++++++++++++++ .../__tests__/compileScript.spec.ts | 20 +++++++++++++++++++ packages/compiler-sfc/src/compileScript.ts | 4 +++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 9dbe37cc9de..79d598ae6f3 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -1323,6 +1323,25 @@ return { Foo } })" `; +exports[`SFC compile + ` + ) + assertCode(content) + expect(bindings).toStrictEqual({ + D: BindingTypes.SETUP_CONST, + C: BindingTypes.SETUP_CONST, + B: BindingTypes.SETUP_CONST, + Foo: BindingTypes.SETUP_CONST + }) + }) + test('const Enum', () => { const { content, bindings } = compile( `