File tree 1 file changed +1
-19
lines changed
packages/sfc-playground/src
1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change 28
28
</template >
29
29
30
30
<script setup lang="ts">
31
- import { exportFiles } from ' ./store'
32
- import { saveAs } from ' file-saver'
31
+ import { downloadProject } from ' ./download/download'
33
32
34
33
function copyLink() {
35
34
navigator .clipboard .writeText (location .href )
36
35
alert (' Sharable URL has been copied to clipboard.' )
37
36
}
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
- }
55
37
</script >
56
38
57
39
<style >
You can’t perform that action at this time.
0 commit comments