From 273d19ad461a46d5b8753be2d2886249947494a6 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 15 Sep 2020 09:51:15 +0800 Subject: [PATCH] fix: should be able to parse decorators in script lang="ts" & jsx (#2088) * fix: should be able to parse decorators in script lang="ts" * fix: should also support parsing jsx Added to `compileScript` instead of `babelParserDefaultPlugins` because it's not needed for template expression parsing --- .../compiler-sfc/__tests__/compileScript.spec.ts | 16 ++++++++++++++++ packages/compiler-sfc/src/compileScript.ts | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/compiler-sfc/__tests__/compileScript.spec.ts b/packages/compiler-sfc/__tests__/compileScript.spec.ts index 11f73975..0a6b9d00 100644 --- a/packages/compiler-sfc/__tests__/compileScript.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript.spec.ts @@ -520,6 +520,22 @@ describe('SFC compile + `) + + expect(scriptAst).toBeDefined() + }) it('recognizes props array declaration', () => { const { bindings } = compile(`