File tree Expand file tree Collapse file tree 3 files changed +2
-48
lines changed
src/BootstrapBlazor/Components/Toolbar Expand file tree Collapse file tree 3 files changed +2
-48
lines changed Original file line number Diff line number Diff line change 22@inherits IdComponentBase
33
44<div @attributes =" AdditionalAttributes" class =" @ClassString" role =" toolbar" aria-label =" toolbar" style =" @StyleString " >
5- <CascadingValue Value =" this" IsFixed =" true" >
6- @ChildContent
7- </CascadingValue >
5+ @ChildContent
86</div >
Original file line number Diff line number Diff line change @@ -30,16 +30,4 @@ public partial class Toolbar
3030 . AddStyle ( "flex-wrap" , "wrap" , IsWrap )
3131 . AddStyleFromAttributes ( AdditionalAttributes )
3232 . Build ( ) ;
33-
34- private readonly List < ComponentBase > _components = [ ] ;
35-
36- /// <summary>
37- /// 添加按钮到工具栏方法
38- /// </summary>
39- public void Add ( ComponentBase component ) => _components . Add ( component ) ;
40-
41- /// <summary>
42- /// 移除按钮到工具栏方法
43- /// </summary>
44- public void Remove ( ComponentBase component ) => _components . Remove ( component ) ;
4533}
Original file line number Diff line number Diff line change @@ -8,11 +8,8 @@ namespace BootstrapBlazor.Components;
88/// <summary>
99/// ToolbarGroup 组件用于在工具栏中添加一组按钮
1010/// </summary>
11- public partial class ToolbarButtonGroup : IAsyncDisposable
11+ public partial class ToolbarButtonGroup
1212{
13- [ CascadingParameter ]
14- private Toolbar ? Toolbar { get ; set ; }
15-
1613 /// <summary>
1714 /// 获得/设置 子组件模板
1815 /// </summary>
@@ -22,33 +19,4 @@ public partial class ToolbarButtonGroup : IAsyncDisposable
2219 private string ? ClassString => CssBuilder . Default ( "bb-toolbar-group btn-group" )
2320 . AddClassFromAttributes ( AdditionalAttributes )
2421 . Build ( ) ;
25-
26- /// <summary>
27- /// <inheritdoc/>
28- /// </summary>
29- protected override void OnInitialized ( )
30- {
31- base . OnInitialized ( ) ;
32-
33- Toolbar ? . Add ( this ) ;
34- }
35-
36- private ValueTask DisposeAsync ( bool disposing )
37- {
38- if ( disposing )
39- {
40- Toolbar ? . Remove ( this ) ;
41- }
42-
43- return ValueTask . CompletedTask ;
44- }
45-
46- /// <summary>
47- /// <inheritdoc/>
48- /// </summary>
49- public async ValueTask DisposeAsync ( )
50- {
51- await DisposeAsync ( true ) ;
52- GC . SuppressFinalize ( this ) ;
53- }
5422}
You can’t perform that action at this time.
0 commit comments