File tree Expand file tree Collapse file tree 4 files changed +258
-208
lines changed
src/GenOne.Blazor.BottomSheet Expand file tree Collapse file tree 4 files changed +258
-208
lines changed Original file line number Diff line number Diff line change 1
1
@page " /counter"
2
2
3
- <h1 >Counter</h1 >
3
+ <div data-bs-header >< h1 >Counter</h1 ></ div >
4
4
5
5
<p role =" status" >Current count: @currentCount </p >
6
6
7
- <button class =" btn btn-primary" @onclick =" IncrementCount " >Click me</button >
7
+ <button class =" btn btn-primary" @onclick =" OnClick " >Click me</button >
8
8
9
9
10
10
@code {
14
14
{
15
15
currentCount ++ ;
16
16
}
17
+
18
+ [Parameter ]
19
+ public EventCallback OnClick { get ; set ; }
17
20
}
Original file line number Diff line number Diff line change 23
23
</tr >
24
24
</thead >
25
25
<tbody data-bs-content >
26
+ <div data-bs-watch />
26
27
@foreach ( var forecast in forecasts )
27
28
{
28
29
<tr >
32
33
<td >@forecast.Summary </td >
33
34
</tr >
34
35
}
35
- <tr data-bs-footer >
36
- <td >Footer </td >
37
- </tr >
36
+ <tr data-bs-footer >
37
+ <td >
38
+ <button @onclick =" OnClick" >click </button >
39
+ </td >
40
+ </tr >
38
41
</tbody >
39
42
</table >
40
43
}
46
49
{
47
50
forecasts = await ForecastService .GetForecastAsync (DateTime .Now );
48
51
}
52
+
53
+ [Parameter ]
54
+ public EventCallback OnClick { get ; set ; }
49
55
}
Original file line number Diff line number Diff line change @@ -9,13 +9,21 @@ Times closed: @_closedCount;
9
9
<button @onclick =" OpenSheet" >Open Sheet</button >
10
10
11
11
<BottomSheetBlazorJs @ref =" _sheet" Sensitivity =" 5" Stops =" new[] { 95 }" OnClosed =" () => _closedCount++" >
12
- <FetchData ></FetchData >
12
+ @if (isTrue )
13
+ {
14
+ <Counter OnClick =" Test" />
15
+ }
16
+ else
17
+ {
18
+ <FetchData OnClick =" Test" />
19
+ }
13
20
</BottomSheetBlazorJs >
14
21
15
22
16
23
@code
17
24
{
18
25
private BottomSheetBlazorJs ? _sheet ;
26
+ private bool isTrue = false ;
19
27
20
28
private int _closedCount ;
21
29
@@ -26,4 +34,9 @@ Times closed: @_closedCount;
26
34
27
35
await _sheet .Open ();
28
36
}
37
+
38
+ private void Test ()
39
+ {
40
+ isTrue = ! isTrue ;
41
+ }
29
42
}
You can’t perform that action at this time.
0 commit comments