Skip to content

Commit 12d06af

Browse files
committed
doc: 更新 CollapseItem 文档
1 parent 94a9488 commit 12d06af

File tree

4 files changed

+82
-6
lines changed

4 files changed

+82
-6
lines changed

src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,5 @@
178178
</DemoBlock>
179179

180180
<AttributeTable Items="@GetAttributes()" />
181+
182+
<AttributeTable Items="@GetCollapseItemAttributes()" Title="@nameof(CollapseItem)" />

src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor.cs

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ private void OnToggle()
3434
new SelectedItem ("Shanghai", "上海") { Active = true },
3535
};
3636

37-
/// <summary>
38-
/// 获得属性方法
39-
/// </summary>
40-
/// <returns></returns>
4137
private AttributeItem[] GetAttributes() =>
4238
[
4339
new()
@@ -65,4 +61,64 @@ private AttributeItem[] GetAttributes() =>
6561
DefaultValue = " — "
6662
}
6763
];
64+
65+
private AttributeItem[] GetCollapseItemAttributes() =>
66+
[
67+
new()
68+
{
69+
Name = "Text",
70+
Description = Localizer["CollapseItemAttributeText"],
71+
Type = "RenderFragment",
72+
ValueList = " — ",
73+
DefaultValue = " — "
74+
},
75+
new()
76+
{
77+
Name = "Icon",
78+
Description = Localizer["CollapseItemAttributeIcon"],
79+
Type = "Func<CollapseItem, Task>",
80+
ValueList = " — ",
81+
DefaultValue = " — "
82+
},
83+
new()
84+
{
85+
Name = "TitleColor",
86+
Description = Localizer["CollapseItemAttributeTitleColor"],
87+
Type = "Func<CollapseItem, Task>",
88+
ValueList = " — ",
89+
DefaultValue = " — "
90+
},
91+
new()
92+
{
93+
Name = "Class",
94+
Description = Localizer["CollapseItemAttributeClass"],
95+
Type = "Func<CollapseItem, Task>",
96+
ValueList = " — ",
97+
DefaultValue = " — "
98+
},
99+
new()
100+
{
101+
Name = "HeaderClass",
102+
Description = Localizer["CollapseItemAttributeHeaderClass"],
103+
Type = "Func<CollapseItem, Task>",
104+
ValueList = " — ",
105+
DefaultValue = " — "
106+
},
107+
new()
108+
{
109+
Name = "HeaderTemplate",
110+
Description = Localizer["CollapseItemAttributeHeaderTemplate"],
111+
Type = "Func<CollapseItem, Task>",
112+
ValueList = " — ",
113+
DefaultValue = " — "
114+
},
115+
new()
116+
{
117+
Name = "IsCollapsed",
118+
Description = Localizer["CollapseItemAttributeIsCollapsed"],
119+
Type = "bool",
120+
ValueList = "true|false",
121+
DefaultValue = "false"
122+
}
123+
];
68124
}

src/BootstrapBlazor.Shared/Locales/en-US.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3859,7 +3859,16 @@
38593859
"Controllability": "Controllability",
38603860
"ControllabilityItem1": "User decision-making: according to the scene can give the user action advice or security tips, but can not replace the user to make decisions;",
38613861
"ControllabilityItem2": "Results controllable: Users are free to perform actions, including undoing, falling back, and terminating the current operation.",
3862-
"ButtonText": "Toggle"
3862+
"ButtonText": "Toggle",
3863+
"HeaderTemplateTitle": "Header Template",
3864+
"HeaderTemplateIntro": "Customize the <b>Header</b> display content by setting <code>HeaderTemplate</code>",
3865+
"CollapseItemAttributeText": "The title of header",
3866+
"CollapseItemAttributeIcon": "The icon of header",
3867+
"CollapseItemAttributeTitleColor": "The color of header",
3868+
"CollapseItemAttributeClass": "The class of item",
3869+
"CollapseItemAttributeHeaderClass": "The class of header",
3870+
"CollapseItemAttributeHeaderTemplate": "Header template",
3871+
"CollapseItemAttributeIsCollapsed": "The item status collapsed"
38633872
},
38643873
"BootstrapBlazor.Shared.Components.Samples.DateTimeRanges": {
38653874
"Title": "Date Time Range Picker",

src/BootstrapBlazor.Shared/Locales/zh-CN.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3859,7 +3859,16 @@
38593859
"Controllability": "可控 Controllability",
38603860
"ControllabilityItem1": "用户决策:根据场景可给予用户操作建议或安全提示,但不能代替用户进行决策;",
38613861
"ControllabilityItem2": "结果可控:用户可以自由的进行操作,包括撤销、回退和终止当前操作等。",
3862-
"ButtonText": "切换"
3862+
"ButtonText": "切换",
3863+
"HeaderTemplateTitle": "Header 模板",
3864+
"HeaderTemplateIntro": "通过设置 <code>HeaderTemplate</code> 自定义 <b>Header</b> 显示内容",
3865+
"CollapseItemAttributeText": "文本文字",
3866+
"CollapseItemAttributeIcon": "图标字符串",
3867+
"CollapseItemAttributeTitleColor": "标题颜色",
3868+
"CollapseItemAttributeClass": "样式名称",
3869+
"CollapseItemAttributeHeaderClass": "Header CSS 样式名称",
3870+
"CollapseItemAttributeHeaderTemplate": "Header 模板",
3871+
"CollapseItemAttributeIsCollapsed": "当前状态是否收缩"
38633872
},
38643873
"BootstrapBlazor.Shared.Components.Samples.DateTimeRanges": {
38653874
"Title": "DateTimeRange 日期时间段选择器",

0 commit comments

Comments
 (0)