Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<MudIcon Icon="@inboxIcon" Color="Color.Primary" />
@code{ // here this Icon string is coming from database private string inboxIcon = "Icons.Material.Filled.Inbox"; }
上面的代码没有显示任何图标。如何绑定此图标字符串?
你快到了。试试这样:
<MudIcon Icon="@inboxIcon" Color="Color.Primary" /> @code{ // here this Icon string is coming from database private string inboxIcon = MudBlazor.Icons.Material.Filled.Inbox; }
命名空间中的Icons会自动转换成字符串。
Icons