You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often when using a select menu, it is desirable to be able select any kind of value from a list of options. Currently, the only available options are string and number.
In this case, we would have to use the id of the person as SelectOption value. When we select a user and want to do something with it, we then have to traverse the list of people and find the selected one by id, which is inefficient and leads to boilerplate code.
This function solves the problem (这个功能解决的问题)
Often when using a select menu, it is desirable to be able select any kind of value from a list of options. Currently, the only available options are
string
andnumber
.Consider a list of people:
In this case, we would have to use the
id
of the person asSelectOption
value. When we select a user and want to do something with it, we then have to traverse the list of people and find the selected one byid
, which is inefficient and leads to boilerplate code.Expected API (期望的 API)
Using the
people
example above:The text was updated successfully, but these errors were encountered: