Quasar: q-input - handler() function's "this" is undefined

Created on 28 Aug 2017  路  1Comment  路  Source: quasarframework/quasar

Hello, I am trying to put + and - signs on q-input number to make it like it was before, but it seems like handler() function's "this" is undefined and not bind to Vue instance, is there a workaround?

Most helpful comment

Hi,

Read about ES6 arrow functions and understand how scoping works with them.

handler () {
   // "this" refers to the scope of this block
}

handler: () => {
   // "this" refers to outer scope, so possibly your Vue component
}

>All comments

Hi,

Read about ES6 arrow functions and understand how scoping works with them.

handler () {
   // "this" refers to the scope of this block
}

handler: () => {
   // "this" refers to outer scope, so possibly your Vue component
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

green-mike picture green-mike  路  3Comments

victorborgaco picture victorborgaco  路  3Comments

florensiuslaylim picture florensiuslaylim  路  3Comments

xereda picture xereda  路  3Comments

jean-moldovan picture jean-moldovan  路  3Comments