Replies: 1 comment 2 replies
-
Might be a problem with Blazor and for loop. You can use temp variables. @foreach (var route in routes)
{
var iconName = route.IconName;
var to = route.Route;
var routeName = route.RouteName;
<BarItem>
<BarLink To="@to">
<BarIcon IconName="@iconName " />
@routeName
</BarLink>
</BarItem>
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I hope this is just my lack of experience in Blazor syntax, but I'm using the BarIcon and everything works great when I do this:
But I'm attempting to define routes dynamically. If I do this same where route.IconName is the string FontAwesomeIcons.Database, nothing shows up. Since FontAwesomeIcons is a helper class that returns a string, how can I use it in a dynamic sense.
Beta Was this translation helpful? Give feedback.
All reactions