File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/layout/src/NoticeIcon Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1616 Class =" list"
1717 DataSource =" @Data"
1818 ItemLayout =" ListItemLayout.Horizontal" >
19- <ListItem >
19+ <ListItem OnClick = " @(()=> HandleItemClick(context.Key)) " >
2020 <!-- todo: Description shoud be RenderFragment-->
2121 @if (string .IsNullOrEmpty (context .Avatar ))
2222 {
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ public partial class NoticeList
1515 [ Parameter ] public bool ShowViewMore { get ; set ; }
1616 [ Parameter ] public EventCallback OnClear { get ; set ; }
1717 [ Parameter ] public EventCallback OnViewMore { get ; set ; }
18+ [ Parameter ] public EventCallback < string > OnItemClick { get ; set ; }
19+
1820 [ Parameter ] public string Title { get ; set ; }
1921
2022 [ CascadingParameter ] public NoticeIcon NoticeIcon { get ; set ; }
@@ -48,5 +50,13 @@ public async Task HandleViewMore()
4850
4951 if ( NoticeIcon . OnViewMore . HasDelegate ) await NoticeIcon . OnViewMore . InvokeAsync ( TabKey ) ;
5052 }
53+
54+ public async Task HandleItemClick ( string key )
55+ {
56+ if ( OnItemClick . HasDelegate )
57+ {
58+ await OnItemClick . InvokeAsync ( key ) ;
59+ }
60+ }
5161 }
5262}
You can’t perform that action at this time.
0 commit comments