-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Third Edition
By :
In Blazor, a component is a .razor file containing a small, isolated functionality (code and markup), or it can be used as a page. A component can host other components as well. This chapter will show us how components work and how to use them.
There are three different ways we can create a component:
.razor fileIn this chapter, we will go through the different options. First, we’ll go through the components in the template we used to create the project; these all use the first option, .razor files, where we have a mix of code and HTML in the same file.
The components in the template are as follows:
The counter page shows a button and a counter; if we click the button, the counter increases. We will now break the page apart, making...