Skip to content

Commit 48ce4c6

Browse files
committed
feat: 增加 ShowBorder 功能
1 parent 56952ab commit 48ce4c6

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@namespace BootstrapBlazor.Components
22
@inherits BootstrapModuleComponentBase
33

4-
<div @attributes="@AdditionalAttributes" id="@Id" style="height: 600px;"></div>
4+
<div @attributes="@AdditionalAttributes" id="@Id" style="@StyleString"></div>

src/components/BootstrapBlazor.EmbedPDF/EmbedPDF.razor.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,17 @@ public partial class EmbedPDF
1818
/// 获得/设置 PDF 组件高度 默认 600px
1919
/// </summary>
2020
[Parameter]
21-
public string? ViewHeight { get; set; }
21+
public string ViewHeight { get; set; } = "600px";
22+
23+
/// <summary>
24+
/// 获得/设置 是否显示外边框
25+
/// </summary>
26+
[Parameter]
27+
public bool ShowBorder { get; set; } = true;
28+
29+
private string? StyleString => CssBuilder.Default()
30+
.AddClass("border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); overflow: hidden;", ShowBorder)
31+
.AddClass($"height: {ViewHeight};", !string.IsNullOrEmpty(ViewHeight))
32+
.AddStyleFromAttributes(AdditionalAttributes)
33+
.Build();
2234
}

0 commit comments

Comments
 (0)