perf: 代码优化 components/ThemeSwitch

This commit is contained in:
pany 2023-05-22 14:04:31 +08:00
parent d22a44396d
commit 8a24b6d219

View File

@ -1,16 +1,12 @@
<script lang="ts" setup>
import { type ThemeName, useTheme } from "@/hooks/useTheme"
import { useTheme } from "@/hooks/useTheme"
import { MagicStick } from "@element-plus/icons-vue"
const { themeList, activeThemeName, setTheme } = useTheme()
const handleSetTheme = (name: ThemeName) => {
setTheme(name)
}
</script>
<template>
<el-dropdown trigger="click" @command="handleSetTheme">
<el-dropdown trigger="click" @command="setTheme">
<div>
<el-tooltip effect="dark" content="主题模式" placement="bottom">
<el-icon :size="20">