File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.EmbedPDF Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11@namespace BootstrapBlazor.Components
22@inherits BootstrapModuleComponentBase
33
4- <div @attributes =" @AdditionalAttributes" id =" @Id" style =" height : 600 px ; " ></div >
4+ <div @attributes =" @AdditionalAttributes" id =" @Id" style =" @ StyleString " ></div >
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments