vue-bootstrap-select
vue-bootstrap-select copied to clipboard
Resolve `valueProp` when it is set
Hey thanks for this Select. I had troubles finding a good select with search, before finding yours. Small issue though :
If i pass items with this format : [{id: 1, value: "item1"}, {id: 2, value: "item2"}]
and i add the props : text-prop="value"
and value-prop="id"
I should get the id
from the v-model, when i select an item from the list. Currently, it returns the whole object
Thank you, I'm glad you find it useful. Actually that's the expected behavior 😬 , you could do object.id
to access it.
I don't understand the use of value-prop
then :/ (since text-prop
works as i expected)
value-prop
is used to find the selected option in the drop down list, but I do understand your point. Though I think is more common to return the entire object than a single prop.
One option could be to add a formatter prop, that you can pass as a function, so that I returns the selected object in the way you want it.
If it's not against your component's design, that would be a great solution