Skip to content

Commit de8f5e2

Browse files
Lambert LeeArgoZhang
authored andcommitted
!3751 doc(#I6ABBE): update scroll demo
* update scroll demo
1 parent f6ac77e commit de8f5e2

6 files changed

Lines changed: 41 additions & 32 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@inject IStringLocalizer<ScrollNormal> Localizer
2+
3+
<div>
4+
<Scroll class="scroll-demo" Height="200px">
5+
<div style="height: 400px;">@Localizer["ScrollNormalDescription"]</div>
6+
<div>@Localizer["ScrollNormalbottom"]</div>
7+
</Scroll>
8+
</div>

src/BootstrapBlazor.Shared/Samples/Scrolls.razor.css renamed to src/BootstrapBlazor.Shared/Demos/Scroll/ScrollNormal.razor.css

File renamed without changes.

src/BootstrapBlazor.Shared/Locales/en.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,16 +1332,18 @@
13321332
"DividerContent": "I am a custom content <code>div</code> element"
13331333
},
13341334
"BootstrapBlazor.Shared.Samples.Scrolls": {
1335-
"Title": "Scroll",
1336-
"H1": "Add scroll bars to components whose height or width exceeds the standard",
1337-
"P1": "The scroll bar can be rendered only when its element has a fixed height. Its <code>height</code> attribute can be set through the coat element",
1338-
"Block1Title": "Common usage",
1339-
"Block1Intro": "Add a scroll bar to the component. By setting the height of <code>Height</code> to 200px, the scroll bar appears when the height of the inner child element is 400px",
1340-
"D1": "Please scroll the scroll bar on the right",
1341-
"D2": "bottom",
1335+
"ScrollTitle": "Scroll",
1336+
"ScrollDescription": "Add scroll bars to components whose height or width exceeds the standard",
1337+
"ScrollTips": "The scroll bar can be rendered only when its element has a fixed height. Its <code>height</code> attribute can be set through the coat element",
1338+
"ScrollNormalTitle": "Common usage",
1339+
"ScrollNormalIntro": "Add a scroll bar to the component. By setting the height of <code>Height</code> to 200px, the scroll bar appears when the height of the inner child element is 400px",
13421340
"Desc1": "Subassembly",
13431341
"Desc2": "Component height"
13441342
},
1343+
"BootstrapBlazor.Shared.Demos.Scroll.ScrollNormal": {
1344+
"ScrollNormalDescription": "Please scroll the scroll bar on the right",
1345+
"ScrollNormalbottom": "bottom"
1346+
},
13451347
"BootstrapBlazor.Shared.Samples.LayoutPages": {
13461348
"H1": "full page level components",
13471349
"P1": "via built-in components",

src/BootstrapBlazor.Shared/Locales/zh.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,16 +1335,18 @@
13351335
"DividerContent": "我是自定义内容 <code>div</code> 元素"
13361336
},
13371337
"BootstrapBlazor.Shared.Samples.Scrolls": {
1338-
"Title": "Scroll 滚动条",
1339-
"H1": "给高度或者宽度超标的组件增加滚动条",
1340-
"P1": "其元素必须拥有固定高度时才可呈现滚动条,可以通过外套元素设置其 <code>height</code> 属性",
1341-
"Block1Title": "普通用法",
1342-
"Block1Intro": "给组件增加滚动条,通过设置 <code>Height</code> 高度值为 200px 使内部子元素高度为 400px 时出现滚动条",
1343-
"D1": "请滚动右侧滚动条",
1344-
"D2": "我是最底端",
1338+
"ScrollTitle": "Scroll 滚动条",
1339+
"ScrollDescription": "给高度或者宽度超标的组件增加滚动条",
1340+
"ScrollTips": "其元素必须拥有固定高度时才可呈现滚动条,可以通过外套元素设置其 <code>height</code> 属性",
1341+
"ScrollNormalTitle": "普通用法",
1342+
"ScrollNormalIntro": "给组件增加滚动条,通过设置 <code>Height</code> 高度值为 200px 使内部子元素高度为 400px 时出现滚动条",
13451343
"Desc1": "子组件",
13461344
"Desc2": "组件高度"
13471345
},
1346+
"BootstrapBlazor.Shared.Demos.Scroll.ScrollNormal": {
1347+
"ScrollNormalDescription": "请滚动右侧滚动条",
1348+
"ScrollNormalbottom": "我是最底端"
1349+
},
13481350
"BootstrapBlazor.Shared.Samples.LayoutPages": {
13491351
"H1": "整页面级别组件",
13501352
"P1": "通过内置组件",
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
@page "/scrolls"
2+
@inject IStringLocalizer<Scrolls> Localizer
23

3-
<h3>@Localizer["Title"]</h3>
4+
<h3>@Localizer["ScrollTitle"]</h3>
45

5-
<h4>@Localizer["H1"]</h4>
6+
<h4>@Localizer["ScrollDescription"]</h4>
67

7-
<p>@((MarkupString)Localizer["P1"].Value)</p>
8+
<p>@((MarkupString)Localizer["ScrollTips"].Value)</p>
89

9-
<DemoBlock Title="@Localizer["Block1Title"]" Introduction="@Localizer["Block1Intro"]" Name="Normal">
10-
<Scroll class="scroll-demo" Height="200px">
11-
<div style="height: 400px;">@Localizer["D1"]</div>
12-
<div>@Localizer["D2"]</div>
13-
</Scroll>
14-
</DemoBlock>
10+
<DemoBlock Title="@Localizer["ScrollNormalTitle"]" Introduction="@Localizer["ScrollNormalIntro"]" Name="Normal" Demo="typeof(Demos.Scroll.ScrollNormal)" />
1511

1612
<AttributeTable Items="@GetAttributes()" />

src/BootstrapBlazor.Shared/Samples/Scrolls.razor.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,35 @@
55
namespace BootstrapBlazor.Shared.Samples;
66

77
/// <summary>
8-
///
8+
/// Scrolls
99
/// </summary>
1010
public sealed partial class Scrolls
1111
{
12-
[Inject]
13-
[NotNull]
14-
private IStringLocalizer<Scrolls>? Localizer { get; set; }
15-
1612
/// <summary>
1713
/// 获得属性方法
1814
/// </summary>
1915
/// <returns></returns>
20-
private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
16+
private IEnumerable<AttributeItem> GetAttributes()
2117
{
18+
return new AttributeItem[]
19+
{
2220
// TODO: 移动到数据库中
23-
new AttributeItem() {
21+
new AttributeItem()
22+
{
2423
Name = "ChildContent",
2524
Description = Localizer["Desc1"],
2625
Type = "RenderFragment",
2726
ValueList = " — ",
2827
DefaultValue = " — "
2928
},
30-
new AttributeItem() {
29+
new AttributeItem()
30+
{
3131
Name = "Height",
3232
Description = Localizer["Desc2"],
3333
Type = "string",
3434
ValueList = " — ",
3535
DefaultValue = " — "
3636
}
37-
};
37+
};
38+
}
3839
}

0 commit comments

Comments
 (0)