In the mounted function of my code, I have this:
mounted () {
document.addEventListener('keydown', function (e) {
switch (e.keyCode) {
case 37 :
alert(this.indexPictures)
break
}
})
}
In my data value:
data: function () {
return {
indexPictures: this.index,
}
},
The result I am getting is undefined.
I am facing an issue where I can't retrieve the value in the data function and the same problem occurs when attempting to access methods. The result I get is 'is not a function'.
Do you have any thoughts on what could be causing this?