2
votes

I have a Vuetify selectlist. When the selectlist changes I want to pass both item-text and item-value as object to my onChange function. How can I do this?

This is my current selectlist:

  <v-select
        :items="items"
        item-text="mediumName"
        item-value="uicCode"
        label="From city"
        solo
        autofocus
        @change="onChangeFrom($event)"
      ></v-select>

I now get the item-value in my onChange function but how can I also get the item-text?

1

1 Answers

2
votes

You need to say return-object and you dont have to pass a parameter into onChangeFrom

  <v-select
        :items="items"
        item-text="mediumName"
        item-value="uicCode"
        label="From city"
        solo
        autofocus
        @change="onChangeFrom"
        return-object
      ></v-select>