File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
src/BootstrapBlazor/Components/HtmlTag Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11@namespace BootstrapBlazor.Components
22@inherits BootstrapComponentBase
33
4- <link @attributes =" AdditionalAttributes" href =" @GetHref()" rel =" stylesheet " />
4+ <link @attributes =" AdditionalAttributes" href =" @GetHref()" rel =" @Rel " />
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ public partial class Link
1616 [ EditorRequired ]
1717 public string ? Href { get ; set ; }
1818
19+ /// <summary>
20+ /// 获得/设置 Rel 属性值, 默认 stylesheet
21+ /// </summary>
22+ [ Parameter ]
23+ public string ? Rel { get ; set ; } = "stylesheet" ;
24+
1925 /// <summary>
2026 /// 获得/设置 版本号 默认 null 自动生成
2127 /// </summary>
Original file line number Diff line number Diff line change @@ -12,9 +12,10 @@ public void Link_Ok()
1212 var cut = Context . RenderComponent < Link > ( pb =>
1313 {
1414 pb . Add ( a => a . Href , "http://www.blazor.zone" ) ;
15+ pb . Add ( a => a . Rel , "stylesheet-test" ) ;
1516 } ) ;
1617 var versionService = cut . Services . GetRequiredService < IVersionService > ( ) ;
17- Assert . Equal ( $ "<link href=\" http://www.blazor.zone?v={ versionService . GetVersion ( ) } \" rel=\" stylesheet\" />", cut . Markup ) ;
18+ Assert . Equal ( $ "<link href=\" http://www.blazor.zone?v={ versionService . GetVersion ( ) } \" rel=\" stylesheet-test \" />", cut . Markup ) ;
1819 }
1920
2021 [ Fact ]
You can’t perform that action at this time.
0 commit comments