mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-19 05:43:03 +00:00
pod update
This commit is contained in:
28
web-front/src/components/DarkMode.vue
Normal file
28
web-front/src/components/DarkMode.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<el-switch
|
||||
v-model="darkMode"
|
||||
size="large"
|
||||
style="--el-switch-on-color: #4882f8; --el-switch-off-color: #ff8000"
|
||||
inline-prompt
|
||||
:active-icon="Moon"
|
||||
:inactive-icon="Sunny"
|
||||
@change="toggleDark"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { useDark, useToggle } from '@vueuse/core'
|
||||
/** 引入Element-Plus图标 */
|
||||
import { Sunny, Moon } from '@element-plus/icons-vue'
|
||||
defineOptions({
|
||||
name: 'DarkMode'
|
||||
})
|
||||
|
||||
/** 切换模式 */
|
||||
const isDark = useDark({})
|
||||
|
||||
const toggleDark = useToggle(isDark)
|
||||
/** 是否切换为暗黑模式 */
|
||||
const darkMode = ref(false)
|
||||
</script>
|
||||
Reference in New Issue
Block a user