Skip to content

Commit 39ba47c

Browse files
authored
feat(IFrame): update default style (#4556)
* chore: 增加字典 * doc: 增加 IFrame 文档链接 * feat: 增加 Height 参数 * doc: 增加 IFrame 示例 * doc: 增加参数文档 * refactor: 更新文档 * chore: 更新 IFrame 默认样式
1 parent c069a65 commit 39ba47c

File tree

7 files changed

+82
-2
lines changed

7 files changed

+82
-2
lines changed

exclusion.dic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,4 @@ noselect
107107
Urls
108108
Pharmacode
109109
bluetooth
110+
iframe
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@page "/iframe"
2+
@inject IStringLocalizer<IFrames> Localizer
3+
4+
<h3>@Localizer["IFrameTitle"]</h3>
5+
6+
<h4>@Localizer["IFrameDescription"]</h4>
7+
8+
<DemoBlock Title="@Localizer["IFrameNormalTitle"]"
9+
Introduction="@Localizer["IFrameNormalIntro"]" Height="600px"
10+
Name="Normal">
11+
<IFrame Src="https://pro.blazor.zone"></IFrame>
12+
</DemoBlock>
13+
14+
<AttributeTable Items="@GetAttributes()" />
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
5+
6+
namespace BootstrapBlazor.Server.Components.Samples;
7+
8+
/// <summary>
9+
/// IFrame 示例文档
10+
/// </summary>
11+
public partial class IFrames
12+
{
13+
private AttributeItem[] GetAttributes() =>
14+
[
15+
new()
16+
{
17+
Name = "Src",
18+
Description = Localizer["AttributeSrc"],
19+
Type = "string",
20+
ValueList = " — ",
21+
DefaultValue = " — "
22+
},
23+
new()
24+
{
25+
Name = "Data",
26+
Description = Localizer["AttributeData"],
27+
Type = "object",
28+
ValueList = " — ",
29+
DefaultValue = " — "
30+
},
31+
new()
32+
{
33+
Name = "OnPostDataAsync",
34+
Description = Localizer["AttributeOnPostDataAsync"],
35+
Type = "Func<object?, Task>",
36+
ValueList = " — ",
37+
DefaultValue = " — "
38+
}
39+
];
40+
}

src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,11 @@ void AddData(DemoMenuItem item)
627627
Url = "icon"
628628
},
629629
new()
630+
{
631+
Text = Localizer["IFrame"],
632+
Url = "iframe"
633+
},
634+
new()
630635
{
631636
Text = Localizer["LinkButton"],
632637
Url = "link-button"

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4635,6 +4635,7 @@
46354635
"ListGroup": "ListGroup",
46364636
"Locator": "IpLocatorFactory",
46374637
"Icon": "Icon",
4638+
"IFrame": "IFrame",
46384639
"ImageViewer": "ImageViewer",
46394640
"FileIcon": "FileIcon",
46404641
"Popover": "Popover",
@@ -6827,5 +6828,14 @@
68276828
"BootstrapBlazor.Server.Data.CustomValidateCollectionModel": {
68286829
"Telephone1": "Telephone 1",
68296830
"Telephone2": "Telephone 2"
6831+
},
6832+
"BootstrapBlazor.Server.Components.Samples.IFrames": {
6833+
"IFrameTitle": "IFrame",
6834+
"IFrameDescription": "Allows embedding documents, videos and interactive media in a page. By doing so, a secondary page can be displayed on the main page. The iFrame element allows including content from other sources, it can integrate content anywhere on the page.",
6835+
"IFrameNormalTitle": "Basic usage",
6836+
"IFrameNormalIntro": "Use the <code>Src</code> parameter to set the URL of other website pages and inline their content into this page",
6837+
"AttributeSrc": "Frame load url",
6838+
"AttributeData": "Data passed",
6839+
"AttributeOnPostDataAsync": "Passed back data"
68306840
}
68316841
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4635,6 +4635,7 @@
46354635
"ListGroup": "列表框 ListGroup",
46364636
"Locator": "位置定位 IpLocatorFactory",
46374637
"Icon": "图标 Icon",
4638+
"IFrame": "内嵌框架 IFrame",
46384639
"ImageViewer": "图片 ImageViewer",
46394640
"FileIcon": "文件图标 FileIcon",
46404641
"Popover": "弹出窗 Popover",
@@ -6827,5 +6828,14 @@
68276828
"BootstrapBlazor.Server.Data.CustomValidateCollectionModel": {
68286829
"Telephone1": "联系电话1",
68296830
"Telephone2": "联系电话2"
6831+
},
6832+
"BootstrapBlazor.Server.Components.Samples.IFrames": {
6833+
"IFrameTitle": "IFrame 内联框架",
6834+
"IFrameDescription": "允许在页面中嵌入文档、视频和交互式媒体。 通过这样做可以在主页上显示一个辅助页面。 iFrame 元素允许包含来自其他源的内容,它可以在页面的任何地方集成内容。",
6835+
"IFrameNormalTitle": "基础用法",
6836+
"IFrameNormalIntro": "通过 <code>Src</code>参数设置其他网站页面地址,内联其内容到本页面中",
6837+
"AttributeSrc": "Frame 加载网页路径",
6838+
"AttributeData": "传递的数据",
6839+
"AttributeOnPostDataAsync": "Frame 加载页面传递过来的数据"
68306840
}
68316841
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.bb-frame {
2-
height: calc(100% - 8px);
1+
.bb-frame {
2+
height: 100%;
33
width: 100%;
44
}

0 commit comments

Comments
 (0)