我正在尝试使用 Razor 参数并将其传递给 Blazor 以进行进一步处理,但我在我尝试构建的 @onclick 事件上收到此错误消息“组件属性不支持复杂内容(混合 C# 和标记)” img标签如下:
<tr>
@{
for (int j = 0; j < Candidates.Length; j++)
{
<th>
<div class="grow">
<img src="/Candidates/@(Candidates[j].ToString()).jfif" alt="@Candidates[j].ToString()" @onclick="IncrementScore(@j)" />
</div>
</th>
}
}
</tr>
Run Code Online (Sandbox Code Playgroud)
任何建议将不胜感激!