]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(sfc-playground): adjust the tooltip text for toggling the theme (#12116)
authorw2xi <57785259+w2xi@users.noreply.github.com>
Fri, 11 Oct 2024 02:31:01 +0000 (10:31 +0800)
committerGitHub <noreply@github.com>
Fri, 11 Oct 2024 02:31:01 +0000 (10:31 +0800)
* chore(sfc-playground): adjust the tooltip text for toggling the theme

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
packages-private/sfc-playground/src/App.vue
packages-private/sfc-playground/src/Header.vue

index c9295d41b0855a3397fa19af3b4266bcb6a98089..d163b1a3ee62cd0089f25f6eb99d372350ac1e14 100644 (file)
@@ -123,6 +123,7 @@ onMounted(() => {
     :prod="productionMode"
     :ssr="useSSRMode"
     :autoSave="autoSave"
+    :theme="theme"
     @toggle-theme="toggleTheme"
     @toggle-prod="toggleProdMode"
     @toggle-ssr="toggleSSR"
index 2778724b0abba05aa702437905b8d4a7e453d40d..aea6c022a3e44bcbbe7485ef0f0904d95ac4f3ff 100644 (file)
@@ -15,6 +15,7 @@ const props = defineProps<{
   prod: boolean
   ssr: boolean
   autoSave: boolean
+  theme: 'dark' | 'light'
 }>()
 const emit = defineEmits([
   'toggle-theme',
@@ -117,7 +118,11 @@ function toggleDark() {
       >
         <span>{{ autoSave ? 'AutoSave ON' : 'AutoSave OFF' }}</span>
       </button>
-      <button title="Toggle dark mode" class="toggle-dark" @click="toggleDark">
+      <button
+        :title="`Switch to ${theme === 'dark' ? 'light' : 'dark'} theme`"
+        class="toggle-dark"
+        @click="toggleDark"
+      >
         <Sun class="light" />
         <Moon class="dark" />
       </button>