Sup folks,
I have a lifecycle hook declared inside component like this:
export default {
created: function() {
console.log(this)
},
}
console prints vueComponent
, all good.
However if I change it to an arrow function like so:
export default {
created: () => {
console.log(this)
},
}
now this
is undefined
.
Why? Thanks in advance for help.