Parcourir la source

workflow(sfc-playground): clear errors in edge cases

Evan You il y a 5 ans
Parent
commit
6cab91dfe8
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      packages/sfc-playground/src/sfcCompiler.ts

+ 2 - 0
packages/sfc-playground/src/sfcCompiler.ts

@@ -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
   }