]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(sfc-playground): hide versions when click iframe & set color-scheme to dark...
author木杉 <zhmushan@qq.com>
Mon, 13 Jun 2022 02:58:27 +0000 (10:58 +0800)
committerGitHub <noreply@github.com>
Mon, 13 Jun 2022 02:58:27 +0000 (22:58 -0400)
packages/sfc-playground/src/App.vue
packages/sfc-playground/src/Header.vue

index 2e123531b4000cad82a3f5388cdf4f19945f232f..33ed68c1043207154f121961238f9b97cfaacaaf 100644 (file)
@@ -82,6 +82,10 @@ function toggleSSR() {
 </template>
 
 <style>
+.dark {
+  color-scheme: dark;
+}
+
 body {
   font-size: 13px;
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
index f2daaf02bda60bb31dccb54b21474e4a3f6e1690..15f22ca66ffb23b3ba068bb002a02d502313394d 100644 (file)
@@ -54,6 +54,11 @@ onMounted(async () => {
   window.addEventListener('click', () => {
     expanded.value = false
   })
+  window.addEventListener('blur', () => {
+    if (document.activeElement?.tagName === 'IFRAME') {
+      expanded.value = false
+    }
+  });
 })
 
 async function fetchVersions(): Promise<string[]> {