v-model on AutoComplete, Dropdown etc

UI Components for Vue
Post Reply
mminotti
Posts: 1
Joined: 20 Nov 2022, 15:21

30 Nov 2022, 06:46

Hello, i'm new here.

I would like the v-model to be filled with the value field of the items, but it is filling with the selected object, is it possible to change that?

Consider items: items: [
{label: 'New York', id: 10
]

When I use the option-value="id" in the dropdown it populates the v-model with the list id. Otherwise it fills in with the item's object.

It is possible on Autocomplete too?

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

26 Dec 2022, 10:14

Think the input type text, v-model gives the entered value. For Dropdown options property lists the all the items and v-model returns only selected items so the development side(developer side) could manage with selected data easily. That's the logic.

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests