Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a method by onChange with q-select (Quasar Framework)

The function isn't running when I change the selected value. How do i fix this? Here is my code:

<q-select
  v-model="single"
  :options="['def', 'abc', '456', '123']"
  use-chips
  label="Select One"
  @input="showChannel()"
/>

JavaScript code:

methods: {
  showChannel(val) {
    console.log(val);
  }
}
like image 814
Chris Avatar asked Dec 19 '25 23:12

Chris


1 Answers

Use @update:model-value instead of @input. (I used Quasar v2.0.3)

So, this is your case below:

<q-select
  v-model="single"
  :options="['def', 'abc', '456', '123']"
  use-chips
  label="Select One"
  // @update:model-value instead of @input 
  @update:model-value="showChannel()" 
/>

Sometimes, Quasar is tricky.

like image 161
Kai - Kazuya Ito Avatar answered Dec 22 '25 16:12

Kai - Kazuya Ito