You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/layouts.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,14 @@ This scenario might be addressed in a future release of Blazor. For more informa
109
109
110
110
Create a wrapper component that's capable of interactivity. In the following example, a wrapper component contains a [Blazor section](xref:blazor/components/sections) that can receive content from a child component.
111
111
112
+
In the `_Imports.razor` file, add an [`@using`](xref:mvc/views/razor#using) directive for sections (<xref:Microsoft.AspNetCore.Components.Sections?displayProperty=fullName>):
113
+
114
+
```razor
115
+
@using Microsoft.AspNetCore.Components.Sections
116
+
```
117
+
118
+
Create the following interactive wrapper component in the `Pages` folder.
119
+
112
120
`Pages/InteractiveWrapper.razor`:
113
121
114
122
```razor
@@ -160,6 +168,8 @@ The `Counter` component can use the wrapper component and set interactive sectio
160
168
}
161
169
```
162
170
171
+
Other components around the app can also wrap content in the `InteractiveWrapper` component and set interactive section content.
0 commit comments