You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将ABP Angular UI的LeptonX主题固定为Light模式?

固定LeptonX Angular主题为Light模式的方法

步骤1:修改全局配置文件

在Angular项目的src/assets/config/app.config.json中,找到theme节点,添加或更新defaultStyle字段为light:

"theme": {
  "defaultStyle": "light"
}

步骤2:强制初始化主题样式(可选)

如果需要彻底屏蔽系统主题同步逻辑,可在根组件中主动设置主题:

  1. 导入主题服务:
import { ThemeService } from '@abp/ng.theme.lepton-x';
  1. 在组件构造函数中注入并设置样式:
constructor(private themeService: ThemeService) {
  this.themeService.setStyle('light');
}

步骤3:验证效果

重启Angular应用后,主题将固定为Light模式,不再随系统设置自动切换。

内容的提问来源于stack exchange,提问作者Justin Lee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 21:33:08