I want to return null
when nothing is selected instead of ""
. With the reduce
function below it still returns ""
. Note that also if something is selected it needs to return the object but with ONLY the id
field in it.
<v-select v-model="answer"
:placeholder="Pick one (or not)"
:options="[{id: 1, label: 'A'}, {id: 2, label: 'B'}]"
:reduce="entry => (entry === '' ? null : {id: entry.id})">
</v-select>