Home > SYS_Window > getCurrentTheme
SYS_Window.getCurrentTheme() method
获取当前主题
签名
typescript
function getCurrentTheme(): Promise<ESYS_Theme>;1
返回值
Promise<ESYS_Theme>
当前主题
备注
获取当前 EDA 主题,**浅色** 或 **深色**
示例
javascript
// 1. 获取当前主题(异步方法,需要 await)
const theme = await eda.sys_Window.getCurrentTheme();
// 2. 展示结果
console.log('当前主题:', theme === 'light' ? '浅色(light)' : '深色(dark)');1
2
3
4
5
2
3
4
5