Skip to content

Commit a276e72

Browse files
committed
chore(sfc-playground): improve buttons
1 parent 8055445 commit a276e72

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/sfc-playground/src/Header.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,18 @@ async function fetchVersions(): Promise<string[]> {
111111
</li>
112112
</ul>
113113
</div>
114-
<button class="toggle-dark" @click="toggleDark">
114+
<button title="Toggle dark mode" class="toggle-dark" @click="toggleDark">
115115
<Sun class="light" />
116116
<Moon class="dark" />
117117
</button>
118-
<button class="share" @click="copyLink"><Share /></button>
119-
<button class="download" @click="downloadProject(store)">
118+
<button title="Copy sharable URL" class="share" @click="copyLink">
119+
<Share />
120+
</button>
121+
<button
122+
title="Download project files"
123+
class="download"
124+
@click="downloadProject(store)"
125+
>
120126
<Download />
121127
</button>
122128
</div>

packages/sfc-playground/src/download/download.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import config from './template/vite.config.js?raw'
77
import readme from './template/README.md?raw'
88

99
export async function downloadProject(store: any) {
10+
if (!confirm('Download project files?')) {
11+
return
12+
}
13+
1014
const { default: JSZip } = await import('jszip')
1115
const zip = new JSZip()
1216

0 commit comments

Comments
 (0)