We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
kiaking
brc-dd
posva
Learn more about funding links in repositories.
Report abuse
1 parent 239d150 commit 6761036Copy full SHA for 6761036
src/client/theme-default/components/VPSwitchAppearance.vue
@@ -1,5 +1,5 @@
1
<script lang="ts" setup>
2
-import { inject } from 'vue'
+import { inject, computed } from 'vue'
3
import { useData } from '../composables/data'
4
import VPSwitch from './VPSwitch.vue'
5
import VPIconMoon from './icons/VPIconMoon.vue'
@@ -10,11 +10,15 @@ const { isDark } = useData()
10
const toggleAppearance = inject('toggle-appearance', () => {
11
isDark.value = !isDark.value
12
})
13
+
14
+const switchTitle = computed(() => {
15
+ return isDark.value ? 'Switch to light theme' : 'Switch to dark theme'
16
+})
17
</script>
18
19
<template>
20
<VPSwitch
- title="toggle dark mode"
21
+ :title="switchTitle"
22
class="VPSwitchAppearance"
23
:aria-checked="isDark"
24
@click="toggleAppearance"
0 commit comments