ill
V2EX  ›  问与答

element plus,如何设置局部组件黑暗模式

  •  
  •   ill · Jul 10, 2024 · 1683 views
    This topic created in 696 days ago, the information mentioned may be changed or developed.

    如题,vue3 项目,已使用 element plus ui 库

    需求描述:一些页面整体偏暗,其中的组件默认是白天模式,看着不协调,但因为每个组件里面可能是各种按钮表单表格之类的组件,一个一个调 css 太麻烦了,想直接使用黑暗模式的组件样式凑合下。

    看官方的教程,好像只能全局修改颜色模式,没找到局部的方法。特来问问各位大佬

    附上官方 element plus 链接: https://element-plus.org/zh-CN/guide/dark-mode.html

    1 replies    2024-07-10 14:22:26 +08:00
    duan602728596
        1
    duan602728596  
       Jul 10, 2024
    可以试试 Config Provider + namespace
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   867 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:49 · PVG 04:49 · LAX 13:49 · JFK 16:49
    ♥ Do have faith in what you're doing.