-
Is there an existing issue for this?
Describe the bug
Expected Behavior如果bind-Values有值,我希望能默认选中它 Interactive render modeInteractive Server (Interactive server-side rendering (interactive SSR) using Blazor Server) Steps To Reproduce官网示例<CheckboxListGeneric @bind-Value="@_selectedFoos" Items="@GenericItems" />将_selectedFoos加上初始值即可 Exceptions (if any)No response .NET VersionNET9.0 Anything else?No response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@gudufy Thank you for filing this issue. In order for us to investigate this issue, please provide a minimalistic repro project that illustrates the problem. |
Beta Was this translation helpful? Give feedback.
-
@gudufy 我没有复现,这种问题还是要提供复现代码,你所谓的赋值即可,不知道你怎么赋值的。这里的学问就大了 |
Beta Was this translation helpful? Give feedback.
-
打开项目,链接到/table,点击修改,正确角色应该选中Editor,但现在没有选中。BootstrapBlazorApp1.zip |
Beta Was this translation helpful? Give feedback.
-
@gudufy 看到你的代码了,跟我猜测的基本一致
你的数据源集合内部候选项都是
双向绑定值
增加 注意你的代码中 |
Beta Was this translation helpful? Give feedback.
@gudufy 看到你的代码了,跟我猜测的基本一致
你的数据源集合内部候选项都是
new
出来的。双向绑定值
v.Roles
也是你在另外一个地方new
出来的。这如何要勾选?他们并不相等。这就是问题所在增加
[Key]
即可注意你的代码中
SysRole
是混乱的,同样的Editor
集合中的Id
是 2 数据中是1
…