AoooR
AoooR

Reputation: 461

Is there a way to watch content of a q-select with use-input property?

Is there a way to watch the text content of a q-input with use-input attribute, please ?

I want to create an autocomplete bar for addresses. First I tried with a separated q-input and q-select and it worked : I watch the v-model of my q-input and I use it to fetch addresses suggestions with my autocomplete API, then I display them on the q-select.

But I want to merge the q-input and q-select, so I added use-input to my q-select, but now the watcher on its v-model is not triggered when I type some text in the q-select. So how can I watch content of q-select with use-input for every character the user type ?

The only solution I see is to keep the two components, a q-input for text entry, and the q-select for selecting results, with style to look like a q-select with use-input attribute :/

Thank you for your help :)

Upvotes: 0

Views: 1595

Answers (2)

AoooR
AoooR

Reputation: 461

Finnaly I found q-select has an @input-value Event

Upvotes: 0

user1547821
user1547821

Reputation: 31

You should use the scope a the v-slot: <template v-slot:no-option="scope"> then you have ur scope.inputValue in the template.

Upvotes: 2

Related Questions