]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow(sfc-playground): pass along analyzed bindings when compiling template
authorEvan You <yyx990803@gmail.com>
Mon, 29 Mar 2021 19:34:57 +0000 (15:34 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 29 Mar 2021 20:11:38 +0000 (16:11 -0400)
packages/sfc-playground/src/store.ts

index 7e5cdcb1bf737649e1cdd69efc7d9d606ac72088..2f38287c5ed542627d93a34d2450b5456975673f 100644 (file)
@@ -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