chore(sfc-playground): improve buttons
This commit is contained in:
parent
8055445b68
commit
a276e7253a
@ -111,12 +111,18 @@ async function fetchVersions(): Promise<string[]> {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<button class="toggle-dark" @click="toggleDark">
|
<button title="Toggle dark mode" class="toggle-dark" @click="toggleDark">
|
||||||
<Sun class="light" />
|
<Sun class="light" />
|
||||||
<Moon class="dark" />
|
<Moon class="dark" />
|
||||||
</button>
|
</button>
|
||||||
<button class="share" @click="copyLink"><Share /></button>
|
<button title="Copy sharable URL" class="share" @click="copyLink">
|
||||||
<button class="download" @click="downloadProject(store)">
|
<Share />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
title="Download project files"
|
||||||
|
class="download"
|
||||||
|
@click="downloadProject(store)"
|
||||||
|
>
|
||||||
<Download />
|
<Download />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,10 @@ import config from './template/vite.config.js?raw'
|
|||||||
import readme from './template/README.md?raw'
|
import readme from './template/README.md?raw'
|
||||||
|
|
||||||
export async function downloadProject(store: any) {
|
export async function downloadProject(store: any) {
|
||||||
|
if (!confirm('Download project files?')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const { default: JSZip } = await import('jszip')
|
const { default: JSZip } = await import('jszip')
|
||||||
const zip = new JSZip()
|
const zip = new JSZip()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user