Просмотр исходного кода

chore(sfc-playground): adjust the tooltip text for toggling the theme (#12116)

* 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>
w2xi 1 год назад
Родитель
Сommit
e0a591e1cd

+ 1 - 0
packages-private/sfc-playground/src/App.vue

@@ -123,6 +123,7 @@ onMounted(() => {
     :prod="productionMode"
     :ssr="useSSRMode"
     :autoSave="autoSave"
+    :theme="theme"
     @toggle-theme="toggleTheme"
     @toggle-prod="toggleProdMode"
     @toggle-ssr="toggleSSR"

+ 6 - 1
packages-private/sfc-playground/src/Header.vue

@@ -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>