i have this code in my mounted function :
mounted () {
document.addEventListener('keydown', function (e) {
switch (e.keyCode) {
case 37 :
alert(this.indexPictures)
break
}
})
}
My data value:
data: function () {
return {
indexPictures: this.index,
}
},
My result : undifined
I don't know why but i can't get value in data function and this is the same problem, from methods access. My result : is not a function
Do you have any ideas ? thanks for you help :)
Via Active questions tagged javascript - Stack Overflow https://ift.tt/m7Z9o1i
Comments
Post a Comment