默认情况下,使用 layui-vue 搭建的网站主题为日间模式。那么如何启用夜间模式呢?下面web建站小编给大家简单介绍一下具体实现代码!
若启用夜间模式, 将 config-provider 组件 theme 属性设置为 dark 值。
复制代码<template>
<lay-config-provider :theme="theme">
<App />
</lay-config-provider>
</template>
<script setup>
const theme = ref('dark')
</script>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
选项配置
默认的夜间模式不满足要求时, 可通过 config-provider 组件 dark-partial 属性进行偏好设置。
复制代码<template>
<lay-config-provider :theme="theme" :dark-partial="darkPartial">
<App />
</lay-config-provider>
</template>
<script setup>
const theme = ref('dark')
const darkPartial = {
brightness: 100,
contrast: 90,
grayscale: 0,
darkSchemeBackgroundColor: "black";
darkSchemeTextColor: "white";
}
</script>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
Dark Partial属性介绍
属性 | 描述 | 类型 | 默认值 | 可选值 |
---|---|---|---|---|
brightness | 亮度 | number | 100 | 0 – 100 |
contrast | 对比度 | number | 100 | 0 – 100 |
grayscale | 灰度值 | number | 0 | 0 – 100 |
darkSchemeBackgroundColor | 背景颜色 | string | – | – |
darkSchemeTextColor | 前景颜色 | string | – | – |
基于Vite/TypeScript/Vue3/ElementPlus+TinkPHP6前后端一体框架——Niucloud Admin
免费开源的 Vue 3 桌面端 UI 组件库——Layui Vue
标签: Layui Vue, Vue3免费开源组件, Vue3组件库, 桌面端UI组件库
上面是“Layui - Vue启用日间模式/夜间模式”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_13027.html
workflows工作流
一只白色小猫comfyui工作流
潜水员,珊瑚,鲸鱼,潜水艇comfyui工作流
金色玫瑰花comfyui工作流
金属埃及人ComfyUI工作流
一只巨大的古代乌龟后面建有一座城市的超现实场景
在森林中心有一座蛇形的房子ComfyUI工作流
一个人一条船一条鱼ComfyUI工作流
3D几何打印人体模型ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!