quasar icon indicating copy to clipboard operation
quasar copied to clipboard

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

Open TKafassis opened this issue 9 years ago • 1 comments

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?

TKafassis avatar Aug 28 '17 08:08 TKafassis

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
}

rstoenescu avatar Aug 28 '17 08:08 rstoenescu