Skip to content

Commit 6761036

Browse files
zh-lxbrc-dd
andauthoredNov 17, 2023
fix(ally): clear up confusion with the title of theme switch (#3215)
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
1 parent 239d150 commit 6761036

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/client/theme-default/components/VPSwitchAppearance.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import { inject } from 'vue'
2+
import { inject, computed } from 'vue'
33
import { useData } from '../composables/data'
44
import VPSwitch from './VPSwitch.vue'
55
import VPIconMoon from './icons/VPIconMoon.vue'
@@ -10,11 +10,15 @@ const { isDark } = useData()
1010
const 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"

0 commit comments

Comments
 (0)
Please sign in to comment.