강의제목 : 5. ASP.NET Core Blazor 소개 및 지원되는 플랫폼
<h3>Dialog</h3>
<div class="card" style="width:22rem">
<div class="card-body">
<h3 class="card-title">@Title</h3>
<p class="card-text">@ChildContent</p><!--부모로 받은 컴포넌트를 해당 위치에 랜더링-->
<button @onclick="OnYes">Yes!</button>
</div>
</div>
<br />
@text
@code {
private string text = string.Empty;
//호출시 매개변수로 받음.
[Parameter]
public string Title { get; set; }
//호출시 매개변수로 컴포넌트를 받음.
[Parameter]
public RenderFragment ChildContent { get; set; }
private void OnYes()
{
text = "Write to the console in C#! 'Yes' button selected.";
}
}
@page "/"
<PageTitle>Index</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />
<hr />
<Dialog Title="제목이야">
Do you want to <i>learn more</i> about Blazor?
</Dialog>
<hr />
<Dialog Title="제목이야2"></Dialog>
끄읕