Skip to content

Commit a44dcc3

Browse files
committed
feat(UniverSheet): add IsDarkMode parameter
1 parent a3bf221 commit a44dcc3

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ public partial class UniverSheet
1919
public Dictionary<string, string>? Plugins { get; set; }
2020

2121
/// <summary>
22-
/// 获得/设置 主题颜色 默认 null 未设置
22+
/// 获得/设置 主题颜色 默认 null 未设置 可设置为 greenTheme
2323
/// </summary>
2424
[Parameter]
2525
public string? Theme { get; set; }
2626

27+
/// <summary>
28+
/// 获得/设置 是否为暗黑模式 默认 null 未设置 自动
29+
/// </summary>
30+
[Parameter]
31+
public bool? IsDarkMode { get; set; }
32+
2733
/// <summary>
2834
/// 获得/设置 语言 默认 null 未设置
2935
/// </summary>
@@ -93,7 +99,15 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
9399
/// <inheritdoc/>
94100
/// </summary>
95101
/// <returns></returns>
96-
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new { Theme, Lang, Plugins, Data, RibbonType = RibbonType.ToDescriptionString() });
102+
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new
103+
{
104+
Theme,
105+
Lang,
106+
Plugins,
107+
Data,
108+
DarkMode = IsDarkMode,
109+
RibbonType = RibbonType.ToDescriptionString()
110+
});
97111

98112
/// <summary>
99113
/// 推送数据方法

0 commit comments

Comments
 (0)