File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
src/BootstrapBlazor/Components/Logout Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 2121 @if (HeaderTemplate == null )
2222 {
2323 <div class =" d-flex flex-fill align-items-center" >
24- <img alt =" avatar" src =" @ImageUrl" >
24+ <img alt =" avatar" src =" @ImageUrl" style = " @ AvatarStyleString " >
2525 <div class =" flex-fill" >
2626 <div class =" logout-dn" >@PrefixDisplayNameText @DisplayName </div >
2727 <div class =" logout-un" >@PrefixUserNameText @UserName </div >
Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ namespace BootstrapBlazor.Components;
1212/// </summary>
1313public partial class Logout
1414{
15- private string ? LogoutClassString => CssBuilder . Default ( "dropdown dropdown-logout" )
16- . AddClassFromAttributes ( AdditionalAttributes )
17- . Build ( ) ;
15+ [ Inject ]
16+ [ NotNull ]
17+ private IStringLocalizer < Logout > ? Localizer { get ; set ; }
1818
1919 /// <summary>
2020 /// 获得/设置 组件当前用户头像
@@ -70,9 +70,19 @@ public partial class Logout
7070 [ Parameter ]
7171 public RenderFragment ? LinkTemplate { get ; set ; }
7272
73- [ Inject ]
74- [ NotNull ]
75- private IStringLocalizer < Logout > ? Localizer { get ; set ; }
73+ /// <summary>
74+ /// Gets or sets the avatar border radius. Default is null.
75+ /// </summary>
76+ [ Parameter ]
77+ public string ? AvatarRadius { get ; set ; }
78+
79+ private string ? LogoutClassString => CssBuilder . Default ( "dropdown dropdown-logout" )
80+ . AddClassFromAttributes ( AdditionalAttributes )
81+ . Build ( ) ;
82+
83+ private string ? AvatarStyleString => CssBuilder . Default ( )
84+ . AddStyle ( "--bb-logout-user-avatar-border-radius" , AvatarRadius , ! string . IsNullOrEmpty ( AvatarRadius ) )
85+ . Build ( ) ;
7686
7787 /// <summary>
7888 /// OnInitialized 方法
Original file line number Diff line number Diff line change 7070 width : var (--bb-logout-user-avatar-width );
7171 height : var (--bb-logout-user-avatar-height );
7272 margin-inline-end : var (--bb-logout-user-avatar-margin-right );
73+ border-radius : var (--bb-logout-user-avatar-border-radius , 0 );
7374}
7475
7576.dropdown-logout .logout-un {
You can’t perform that action at this time.
0 commit comments