Skip to content

Commit

Permalink
chore: add sfc playground local debug shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 8, 2023
1 parent 287bd99 commit 62e71b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/sfc-playground/src/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
}
Expand All @@ -63,7 +68,7 @@ onMounted(async () => {
if (document.activeElement?.tagName === 'IFRAME') {
expanded.value = false
}
});
})
})
async function fetchVersions(): Promise<string[]> {
Expand Down

0 comments on commit 62e71b5

Please sign in to comment.