Returning objects as values from v-select (multiple) doesn't work
See original GitHub issueSteps to reproduce
- Create a
v-select
with themultiple
attribute and add items like{ text: 'foo', value: { } }
(objects as values) - Select at least two items in the dropdown
Versions
Vuetify 0.14.1 Vue 2.4.1
What is expected ?
The value
objects of the selected items should be returned in v-model
. This works for me in 0.13.1.
What is actually happening ?
The selection is broken; null values are returned, checked items are not highlighted in the dropdown.
Reproduction Link
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
HTML select multiple doesn't return an array - Stack Overflow
For a multi-select, .val() returns an array of the selected values, so .val()[1] is a string. .value is a property of input elements, ......
Read more >Returning Multiple Values from a Function - JavaScript Tutorial
To return multiple values from a function, you can pack the return values as elements of an array or as properties of an...
Read more >Selection and Range - The Modern JavaScript Tutorial
A Range object is created without parameters: let range = new Range();. Then we can set the selection boundaries using range.
Read more >QuerySet API reference | Django documentation
Returns a new QuerySet containing objects that match the given lookup parameters. The lookup parameters ( **kwargs ) should be in the format...
Read more >Select2 3.5.3
When placeholder is used for a non-multi-value select box, it requires that you ... data can also itself be a function that returns...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Already noted by John, but is a hint for future reference: the prop
return-object
did the trick for me.You were missing your
item-value
declaration. Since you are using a nested object for it. You were also missing the propreturn-object
to return the object as the response.https://codepen.io/johnjleider/pen/jwoNrG