-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat(UniverSheet): add RibbonType parameter #855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,12 @@ public partial class UniverSheet | |
| [Parameter] | ||
| public string? Lang { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 设置工具栏样式 默认 default 未设置 | ||
| /// </summary> | ||
| [Parameter] | ||
| public UniverSheetRibbonType RibbonType { get; set; } | ||
|
Comment on lines
+33
to
+37
|
||
|
|
||
| /// <summary> | ||
| /// 获得/设置 需要传递的数据 | ||
| /// </summary> | ||
|
|
@@ -87,7 +93,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) | |
| /// <inheritdoc/> | ||
| /// </summary> | ||
| /// <returns></returns> | ||
| protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new { Theme, Lang, Plugins, Data }); | ||
| protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new { Theme, Lang, Plugins, Data, RibbonType = RibbonType.ToDescriptionString() }); | ||
|
|
||
| /// <summary> | ||
| /// 推送数据方法 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||
| // Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. | ||||||
|
||||||
| // Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. | |
| // Copyright (c) Argo Zhang (argo@163.com). All rights reserved. |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The website URL in this file is "https://www.blazor.zone", which is inconsistent with other files in the same directory (e.g., UniverSheetData.cs, UniverSheet.razor.cs) that use "https://www.blazor.zone or https://argozhang.github.io/". The header format should be consistent across all files in the component.
| // Website: https://www.blazor.zone | |
| // Website: https://www.blazor.zone or https://argozhang.github.io/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Explicitly initialize
RibbonTypetoUniverSheetRibbonType.Defaultto make the intended default resilient to future enum changes.This currently depends on
RibbonTypedefaulting to the enum’s implicit0value beingDefault. If the enum order changes or a new value is added beforeDefault, the runtime default will change unintentionally. Initializing it explicitly (e.g.public UniverSheetRibbonType RibbonType { get; set; } = UniverSheetRibbonType.Default;) makes the intended default robust to such changes.