Comments (15)
你是否给页面的背景色设置了白色?main 部分应该是透明的。
from vexip-ui.
没有设置白色的背景, 我给你看一下代码
from vexip-ui.
from vexip-ui.
from vexip-ui.
只要我重新点左上角的头像,在里面切换深色模式,main的内容会变深色,但是我只要刷新main就会变成白色
from vexip-ui.
你可以往上挨个检查元素的背景色是否被设置,因为 main 部分(即白色的部分)的背景颜色是透明的。
如果你还是没找到,那最好你可以提供一个复现的项目。
from vexip-ui.
这是我的pinia源码, 我检查过上级元素, 并没有设置白色, css我没有写过, 不过我还是会试着找出问题的, 不过现在还没有什么头绪...
from vexip-ui.
检查了元素, 使用正则匹配查找, 都没有设置白色背景, 或者是我的main.ts有问题,稍等我截图一下,然后需要复现问题等我把源代码上传到git
from vexip-ui.
from vexip-ui.
还是不可以, 我试过了, 我还尝试了一个场景, 就是在我什么都不配置的情况下, 用 layout 组件, 通过点右上角头像切换称 dark 主题之后, 刷新一次页面还是会变成light, 官网上也是如此, 默认是dark主题, 我再切换成 light 主题刷新页面, 会变成 dark 主题。。。。, 我实在不知道是什么原因了, 也可能是我使用的是 linux 的原因 ?现在目前看来只能相信玄学了
from vexip-ui.
如果你想持久化主题,你需要自己做持久化保存。比如像文档,是通过 localStorage 持久化的:
然后在 dark-mode
属性变化时保存到 localStorage:
Layout 组件的 dark-mode
属性是同时可以用来指定内部切换主题 Switch 的初始值的,但如果你通过 document.documentElement
的类名来动态添加 'dark'
类名,Layout 初始化时会检测它。
文档的 Layout 示例没有做持久化操作,当然你刷新之后就会变回原来的主题了。
from vexip-ui.
我一开始就是通过这种方式持久化了主题, 然而就会出现上面的问题
from vexip-ui.
请稍等一会, 明天我会上传问题的项目,把这个 bug 复刻出来
from vexip-ui.
太不好意思了,,,这几天有点事,问题已经复现并上传
https://github.com/NatholDallas/enshrine/blob/dev/client/src/views/HomeView.vue
from vexip-ui.
目前修复这个问题的只能手动修复,在LayoutMain 中判断是否 Darkmode 然后自己设置颜色, 黑色就是 #121212, 白色主题就是 #ffffff..................
from vexip-ui.
Related Issues (20)
- [Cascader] Label fails to disappear when value is cleared
- 增加 InputGroup 功能 HOT 1
- 折叠面板,无法根据响应式自动切换指定的面板 HOT 1
- [Form] Schema validation HOT 5
- nuxt模板项目dev资源加载异常
- Pagination组件选中状态 HOT 4
- Dynamic format label in datepicker HOT 1
- 请求实现 Descriptions 组件以展示键值对数据
- [Avatar]: Wrong scale applied when inside a dropdown
- make focus in timepicker HOT 1
- Modal 开启隐藏遮罩并关闭后页面无法进行交互
- 设置组件名命名空间后,用 `unplugin-vue-components` 和 `unplugin-auto-import` 自动引入后组件样式不生效
- `expandItemByLabel` 没生效 HOT 1
- `menu` `children` 仅有唯一子项时只渲染唯一子项 HOT 2
- `Pagination` 分页选中状态丢失
- [Tree]: Warning about duplicate keys HOT 2
- Date picker and time picker throwing wrong value when using format
- Add InputPin Component
- [Form] Native <button> in form will trigger the web page reload HOT 2
- [Dropdown] @outside-click event was not triggered HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vexip-ui.