Back to Blog
Flowlayout vs table layout6/22/2023 ![]() ![]() The _Imports.razor file is similar to the _ViewImports.cshtml file for Razor views and pages but applied specifically to Razor component files. There's no need to repeatedly add DoctorWhoLayout to all of the Razor components (. Therefore, an _Imports.razor file containing DoctorWhoLayout ensures that all of the components in a folder use the DoctorWhoLayout component. The compiler includes the directives specified in the imports file in all of the Razor templates in the same folder and recursively in all of its subfolders. Set as the app's default layout, as described in the Apply a default layout to an app section later in this article.Įvery folder of an app can optionally contain a template file named _Imports.razor.Set by an directive imported from an _Imports component ( _Imports.razor), as described in the following Apply a layout to a folder of components section.Specifying the layout directly in a component overrides a default layout: ) come from the Episodes component.ĭoctor Who is a registered trademark of the BBC. ) come from the DoctorWhoLayout component. The Doctor Who™ Episode Database heading (.Extraneous markup doesn't appear in order to focus on the content provided by the two components involved: ![]() The following rendered HTML markup is produced by the preceding DoctorWhoLayout and Episodes component. ![]()
0 Comments
Read More
Leave a Reply. |