]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: add sfc playground local debug shortcut
authorEvan You <yyx990803@gmail.com>
Mon, 8 May 2023 07:50:11 +0000 (15:50 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 8 May 2023 07:50:11 +0000 (15:50 +0800)
packages/sfc-playground/src/Header.vue

index b55f024090687ba89b20777a1647c25dc5e96d31..45db4d3af05197309c9c7af06df6bee9685f24a7 100644 (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[]> {