refactor: migrate to nuxt

This commit is contained in:
YunYouJun
2023-07-30 03:08:42 +08:00
parent c23f39e8c0
commit 0dfec1831b
90 changed files with 7864 additions and 3962 deletions

21
components/DarkToggle.vue Normal file
View File

@@ -0,0 +1,21 @@
<script setup lang="ts">
const color = useColorMode()
useHead({
meta: [{
id: 'theme-color',
name: 'theme-color',
content: () => color.value === 'dark' ? '#222222' : '#ffffff',
}],
})
function toggleDark() {
color.preference = color.value === 'dark' ? 'light' : 'dark'
}
</script>
<template>
<button class="mx-2 icon-btn hover:text-yellow-400 !outline-none" title="切换" @click="toggleDark()">
<div i="ri-sun-line dark:ri-moon-line" />
</button>
</template>