i'm trying to add multiple images and i can't find a way to make it work.
I have this method:
imageAdd(e) {
e.forEach(function(e) {
if (e.type == 'image/jpeg' || e.type == 'image/png')
{
this.images.push({
image: URL.createObjectURL(e),
imageData: e
})
}
})
},
When i try to push to images array, it brings me this error Cannot read property 'images' of undefined although it is defined inside my data. What's the problem here?
.forEach(/*...*/, this)or.forEach(/*...*/.bind(this)or related.for ... ofinstead of.forEach, which is often superior anyways