]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow(sfc-playground): fix download
authorEvan You <yyx990803@gmail.com>
Mon, 29 Mar 2021 03:48:01 +0000 (23:48 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 29 Mar 2021 03:48:01 +0000 (23:48 -0400)
packages/sfc-playground/src/Header.vue

index bdcc02a3620f286a15d5f1d666f428fc4a6742f8..7d0d501cc2189a91c21f45a34275733ca03bf536 100644 (file)
 </template>
 
 <script setup lang="ts">
-import { exportFiles } from './store'
-import { saveAs } from 'file-saver'
+import { downloadProject } from './download/download'
 
 function copyLink() {
   navigator.clipboard.writeText(location.href)
   alert('Sharable URL has been copied to clipboard.')
 }
-
-async function downloadProject() {
-  const { default: JSZip } = await import('jszip')
-  const zip = new JSZip()
-
-  // basic structure
-
-  // project src
-  const src = zip.folder('src')!
-  const files = exportFiles()
-  for (const file in files) {
-    src.file(file, files[file])
-  }
-
-  const blob = await zip.generateAsync({ type: 'blob' })
-  saveAs(blob, 'vue-project.zip')
-}
 </script>
 
 <style>