When I reference this in any of the the lifecycle hooks (created, mounted, updated, etc.) it evaluates to undefined:
mounted: () => { console.log(this); // logs "undefined" },

The same thing is also happening inside my computed properties:
computed: { foo: () => { return this.bar + 1; } }

I get the following error:
Uncaught TypeError: Cannot read property 'bar' of undefined

Why is this evaluating to undefined in these cases?

Write your answer...

It's not the same without you

Join the community to find out what other Ednsquare users are discussing, debating and creating.