From: Evan You Date: Mon, 8 May 2023 07:50:11 +0000 (+0800) Subject: chore: add sfc playground local debug shortcut X-Git-Tag: v3.3.0-beta.5~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62e71b5320cd9bff57e2f515342dfb0a3ba208ec;p=thirdparty%2Fvuejs%2Fcore.git chore: add sfc playground local debug shortcut --- diff --git a/packages/sfc-playground/src/Header.vue b/packages/sfc-playground/src/Header.vue index b55f024090..45db4d3af0 100644 --- a/packages/sfc-playground/src/Header.vue +++ b/packages/sfc-playground/src/Header.vue @@ -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 {