[Vuejs]-Why 'this' is undefined in vue2.0, but I can see 'this' in chrome debugger viewer?

0👍

It’s explained in the docs:

Note that you should not use an arrow function to define a method (e.g. plus: () => this.a++). The reason is arrow functions bind the parent context, so this will not be the Vue instance as you expect and this.a will be undefined.

Leave a comment