File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/client/theme-default/components Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11<script lang="ts" setup>
2- import { inject } from ' vue'
2+ import { inject , computed } from ' vue'
33import { useData } from ' ../composables/data'
44import VPSwitch from ' ./VPSwitch.vue'
55import VPIconMoon from ' ./icons/VPIconMoon.vue'
@@ -10,11 +10,15 @@ const { isDark } = useData()
1010const toggleAppearance = inject (' toggle-appearance' , () => {
1111 isDark .value = ! isDark .value
1212})
13+
14+ const switchTitle = computed (() => {
15+ return isDark .value ? ' Switch to light theme' : ' Switch to dark theme'
16+ })
1317 </script >
1418
1519<template >
1620 <VPSwitch
17- title =" toggle dark mode "
21+ : title =" switchTitle "
1822 class =" VPSwitchAppearance"
1923 :aria-checked =" isDark"
2024 @click =" toggleAppearance"
You can’t perform that action at this time.
0 commit comments