We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
多合一的开箱即用 vue3 暗黑模式开关组件
Github 👉 vue-dark-switch
暗黑模式开关是一个项目中常用的功能,为了减少后续新项目的工作量,所以封装了这个组件。
naive-ui
npm i vue-dark-switch -D
<script> import { Switch } from 'vue-dark-switch' </script> <template> <Switch /> </template>
import { isDark, toggleDark } from 'vue-dark-theme' isDark.value // 是否是暗黑模式 toggleDark(false) // 取消暗黑模式 toggleDark(true) // 开启暗黑模式 toggleDark() // 切换模式
<!-- App.vue --> <script setup> import { NConfigProvider } from 'naive-ui' import { naiveTheme } from 'vue-dark-switch' </script> <template> <n-config-provider :theme="naiveTheme"> <router-view /> </n-config-provider> </template>
该组件由以下库搭建而成
The text was updated successfully, but these errors were encountered:
No branches or pull requests
vue-dark-switch
多合一的开箱即用 vue3 暗黑模式开关组件
仓库
Github 👉 vue-dark-switch
动机
暗黑模式开关是一个项目中常用的功能,为了减少后续新项目的工作量,所以封装了这个组件。
特性
naive-ui
支持使用
安装
基础
手动
naive-ui
支持Refs
该组件由以下库搭建而成
The text was updated successfully, but these errors were encountered: