默认情况下,使用 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>
选项配置
默认的夜间模式不满足要求时, 可通过 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>
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启用日间模式/夜间模式”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_13027.html
workflows工作流
一个精心制作的微型赛车场ComfyUI工作流
一只漂亮的孔雀的尾巴完全由披萨制成ComfyUI工作流
一盒用五颜六色的食材烹制的热气腾腾的寿司
一座古老的石阶,旁边有一棵树
丛林里坐着一尊佛像
一颗巨型的木星ComfyUI工作流
一个男孩在吃西瓜ComfyUI工作流
树上挂着一只快乐香蕉ComfyUI工作流一
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

如何利用css3+js做一个下雨效果
一个包含老黄历、佛历、道历、星宿等数据的日历网站
css3搭积木叠加图形
3D彩色卡片
利用js做一个炫酷音乐背景效果
jquery鼠标滑过图片边框特效(jquery.focus-follow插件)
css3画弹珠,可以滚动!
jquery做一个漂亮挂墙动态时钟










