]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow(sfc-playground): clear errors in edge cases
authorEvan You <yyx990803@gmail.com>
Tue, 30 Mar 2021 16:49:50 +0000 (12:49 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 30 Mar 2021 16:49:50 +0000 (12:49 -0400)
packages/sfc-playground/src/sfcCompiler.ts

index 79a088c09c1b25efc85dff1f19b9aa54e60a1910..15b24e4c02bd57555b124575b5b5e293b2cecaa4 100644 (file)
@@ -19,11 +19,13 @@ export const SANDBOX_VUE_URL = import.meta.env.PROD
 
 export async function compileFile({ filename, code, compiled }: File) {
   if (!code.trim()) {
+    store.errors = []
     return
   }
 
   if (filename.endsWith('.js')) {
     compiled.js = compiled.ssr = code
+    store.errors = []
     return
   }