feat(theme-color): toggle theme color along with dark mode using useHead (#20)

* feat(theme-color): toggle theme color along with dark mode

* feat(theme-color): toggle theme color along with dark mode using useHead

Co-authored-by: bryce <1907004005@gmail.com>
This commit is contained in:
guygubaby
2022-04-25 00:00:11 +08:00
committed by GitHub
parent 0dd3373bc2
commit 1e8905275b
2 changed files with 9 additions and 2 deletions

View File

@@ -1,11 +1,19 @@
<script setup lang="ts">
import { isDark } from '~/composables'
// https://github.com/vueuse/head
// you can use this to manipulate the document head in any components,
// they will be rendered correctly in the html results with vite-ssg
useHead({
title: '隔离食用手册',
meta: [
{ name: 'description', content: '好的,今天我们来做菜!' },
{
name: 'description',
content: '好的,今天我们来做菜!',
},
{
name: 'theme-color',
content: computed(() => isDark.value ? '#121212' : '#fff'),
},
],
})
</script>