📝 Update component docs
continuous-integration/drone/push Build is passing Details

master
Julien Riboulet 2 years ago
parent 9f0ee156f9
commit cfef683d7a

@ -78,12 +78,19 @@ public partial class Index
private List<CraftingRecipe> Recipes { get; set; } = new List<CraftingRecipe>();
protected override async Task OnInitializedAsync()
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnInitializedAsync();
base.OnAfterRenderAsync(firstRender);
if (!firstRender)
{
return;
}
Items = await DataService.List(0, await DataService.Count());
Recipes = await DataService.GetRecipes();
StateHasChanged();
}
}
```

@ -96,7 +96,7 @@ public partial class CraftingItem
Il est possible de créer aussi des fichiers de style CSS directement pour notre composant, ce fichier sera automatiquement rendu avec notre composant.
```css title="Components/CraftingItem.razor.cs"
```css title="Components/CraftingItem.razor.css"
.item {
width: 64px;
height: 64px;

@ -78,12 +78,19 @@ public partial class Index
private List<CraftingRecipe> Recipes { get; set; } = new List<CraftingRecipe>();
protected override async Task OnInitializedAsync()
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnInitializedAsync();
base.OnAfterRenderAsync(firstRender);
if (!firstRender)
{
return;
}
Items = await DataService.List(0, await DataService.Count());
Recipes = await DataService.GetRecipes();
StateHasChanged();
}
}
```

Loading…
Cancel
Save