Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
@change does not trigger function in method (in quasar)

I am trying to get select value while selecting an option in a function which is called in methods, but it does not trigger the function.

My code:

from template :

<q-select filled v-model="invoice_product.tarrif_item_id"  @change="getItem($event)" use-input 
   input-debounce="0" 
   label="Search Item Name" :options="options" @filter="filterFn" dense behavior="menu" 
   class="q-ma-xs" option-value="id" option-label="name" emit-value map-options>
       <template v-slot:no-option>
            <q-item>
                <q-item-section class="text-grey">
                   No results
                </q-item-section>
             </q-item>
       </template>
  </q-select>

From methods:

methods: {
    getItem(event) {
        alert(event.target.value)
    }
},

Nothing happens while selecting an option.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try to use @input instead of @change:

new Vue({
  el: '#q-app',
  data: function () {
    return {
      options: [{id:1, name: 'a'},{id:2, name: 'b'},{id:3, name: 'c'}],
      invoice_product: {}
    }
  },
  methods: {
    getItem(event) {
        console.log(event)
    }
  },
})
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/quasar@1.19.5/dist/quasar.min.css" rel="stylesheet" type="text/css">
<div id="q-app">
  <q-select filled v-model="invoice_product.tarrif_item_id"  @input="getItem($event)" use-input 
   input-debounce="0" 
   label="Search Item Name" :options="options" dense behavior="menu" 
   class="q-ma-xs" option-value="id" option-label="name" emit-value map-options>
       <template v-slot:no-option>
            <q-item>
                <q-item-section class="text-grey">
                   No results
                </q-item-section>
             </q-item>
       </template>
  </q-select>
  {{invoice_product}}
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@^2.0.0/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/quasar@1.19.5/dist/quasar.umd.min.js"></script>

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!