9 lines
453 B
Vue
9 lines
453 B
Vue
|
|
<script setup lang="ts">
|
||
|
|
import { Moon, Sunny } from '@element-plus/icons-vue'
|
||
|
|
import { useTheme } from '../composables/useTheme'
|
||
|
|
const { dark, toggle } = useTheme()
|
||
|
|
</script>
|
||
|
|
<template>
|
||
|
|
<el-button class="theme-toggle" :aria-label="dark ? '切换浅色主题' : '切换深色主题'" :title="dark ? '切换浅色主题' : '切换深色主题'" @click="toggle"><el-icon :size="18"><Sunny v-if="dark" /><Moon v-else /></el-icon></el-button>
|
||
|
|
</template>
|