@page "/"
<h1>Flash Animation</h1>
<table>
<thead><tr><th>Name</th></tr></thead>
<tbody>
@foreach(var r in rows)
{
<tr>
<td class="new-item">@r</td>
</tr>
}
</tbody>
</table>
<hr/>
Add new item: <input @bind="NewName">
<button @onclick="AddRow">Add</button>
@code
{
List<string> rows = new List<string>();
string NewName ="";
void AddRow()
{
if(!string.IsNullOrEmpty(NewName))
{
rows.Add(NewName);
NewName = "";
}
}
}