From 7ab519cc96e939956c6ca67d05160e8de47b17e0 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 29 Mar 2021 15:34:57 -0400 Subject: [PATCH] workflow(sfc-playground): pass along analyzed bindings when compiling template --- packages/sfc-playground/src/store.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/sfc-playground/src/store.ts b/packages/sfc-playground/src/store.ts index 7e5cdcb1..2f38287c 100644 --- a/packages/sfc-playground/src/store.ts +++ b/packages/sfc-playground/src/store.ts @@ -140,9 +140,10 @@ async function compileFile({ filename, code, compiled }: File) { } // script + let compiledScript if (descriptor.script || descriptor.scriptSetup) { try { - const compiledScript = compileScript(descriptor, { + compiledScript = compileScript(descriptor, { id, refSugar: true, inlineTemplate: true @@ -172,7 +173,10 @@ async function compileFile({ filename, code, compiled }: File) { id, scoped: hasScoped, slotted: descriptor.slotted, - isProd: false + isProd: false, + compilerOptions: { + bindingMetadata: compiledScript && compiledScript.bindings + } }) if (templateResult.errors.length) { store.errors = templateResult.errors