File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
src/BootstrapBlazor/Components/ImagePreviewer Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 22@inherits BootstrapModuleComponentBase
33@attribute [BootstrapModuleAutoLoader]
44
5- <div tabindex = " -1 " class = " bb-previewer collapse active " id =" @Id " style =" z-index : @ZIndex; " >
5+ <div attributes = " @AdditionalAttributes " id = " @Id " tabindex = " -1 " class =" @ClassString " style =" @ StyleString " >
66 <div class =" bb-viewer-mask" ></div >
77 <div class =" bb-viewer-canvas" >
88 <img src =" @GetFirstImageUrl()" class =" bb-viewer-img" style =" transform : scale (1 ) rotate (0deg ); margin : 0 ;" />
Original file line number Diff line number Diff line change @@ -92,6 +92,15 @@ public partial class ImagePreviewer
9292
9393 private bool ShowButtons => PreviewList . Count > 1 ;
9494
95+ private string ? ClassString => CssBuilder . Default ( "bb-previewer collapse active" )
96+ . AddClassFromAttributes ( AdditionalAttributes )
97+ . Build ( ) ;
98+
99+ private string ? StyleString => CssBuilder . Default ( )
100+ . AddClass ( $ "--bb-viewer-zindex: { ZIndex } ;", ZIndex > 0 )
101+ . AddStyleFromAttributes ( AdditionalAttributes )
102+ . Build ( ) ;
103+
95104 /// <summary>
96105 /// 显示图片
97106 /// </summary>
Original file line number Diff line number Diff line change 88 right : 0 ;
99 bottom : 0 ;
1010 left : 0 ;
11+ z-index : var (--bb-viewer-zindex , 5 );
1112
1213 & .active {
1314 .bb-viewer-full-screen {
You can’t perform that action at this time.
0 commit comments