Ok I get it from your example. options
should be in data
(which makes sense…).
Thanks !
Latest posts made by Crazralfrill
-
RE: QSelect to fetch data from server
-
RE: QSelect to fetch data from server
@metalsadman What do you mean ?
I’m callingthis.options = [{"value": test2, "label": "test2"}];
infetchSources
(post #1) but it does nothing.
It should display the “test2” option but it displays nothing. -
RE: QSelect to fetch data from server
@metalsadman That’s what I did, but in the example, the options prop is set as
stringOptions = [ 'Google', 'Facebook', 'Twitter', 'Apple', 'Oracle' ]
My code :
<q-select v-model="sources" multiple use-input @filter="fetchSources" :options="[]" style="width:300px" label="Filtrer par source" />
And I call
update
to setthis.options
but it’s not working unless theoptions
props of QSelect already contains the value returned infetchSources
.
Which is useless of course, because I want the options to be dynamic and dependant of the server returned values. -
QSelect to fetch data from server
Hello,
I’m trying to use QSelect to show and filter data from a server.
So I want my q-select to be empty at first, and when the user starts to type 1 or 2 characters, it sends a request to the server to get the select values.
I don’t understand how to do it.
I tried to populate the select with the @filter event :fetchSources (val, update) { update( () => { // get data from server this.options = [{value:"test2", label:"test2"}] }) },
But it does nothing because it needs the “test2” options already exists in the :options prop of q-select.
So what’s the proper way to implement this ?
Thanks.