默认情况下,使用 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工作流
一幅3D农场游戏画面ComfyUI工作流
汉堡里的一只毛茸茸的小猫ComfyUI工作流
一尊白玉猴王ComfyUI工作流
潜水员,珊瑚,鲸鱼,潜水艇comfyui工作流
一块慕斯蛋糕ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!