Skip to content

Commit ce5e0b6

Browse files
committed
workflow(sfc-playground): fix download
1 parent 9613969 commit ce5e0b6

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

packages/sfc-playground/src/Header.vue

+1-19
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,12 @@
2828
</template>
2929

3030
<script setup lang="ts">
31-
import { exportFiles } from './store'
32-
import { saveAs } from 'file-saver'
31+
import { downloadProject } from './download/download'
3332
3433
function copyLink() {
3534
navigator.clipboard.writeText(location.href)
3635
alert('Sharable URL has been copied to clipboard.')
3736
}
38-
39-
async function downloadProject() {
40-
const { default: JSZip } = await import('jszip')
41-
const zip = new JSZip()
42-
43-
// basic structure
44-
45-
// project src
46-
const src = zip.folder('src')!
47-
const files = exportFiles()
48-
for (const file in files) {
49-
src.file(file, files[file])
50-
}
51-
52-
const blob = await zip.generateAsync({ type: 'blob' })
53-
saveAs(blob, 'vue-project.zip')
54-
}
5537
</script>
5638

5739
<style>

0 commit comments

Comments
 (0)