chore: add sfc playground local debug shortcut

This commit is contained in:
Evan You 2023-05-08 15:50:11 +08:00
parent 287bd99994
commit 62e71b5320
1 changed files with 7 additions and 2 deletions

View File

@ -41,7 +41,12 @@ function resetVueVersion() {
expanded.value = false
}
async function copyLink() {
async function copyLink(e: MouseEvent) {
if (e.metaKey) {
// hidden logic for going to local debug from play.vuejs.org
window.location.href = 'http://localhost:5173/' + window.location.hash
return
}
await navigator.clipboard.writeText(location.href)
alert('Sharable URL has been copied to clipboard.')
}
@ -63,7 +68,7 @@ onMounted(async () => {
if (document.activeElement?.tagName === 'IFRAME') {
expanded.value = false
}
});
})
})
async function fetchVersions(): Promise<string[]> {