While utilizing Nuxt.js, I am fetching random images from URLs structured like this:
http://www.randomimage.com?ID=myId
To display 2 pictures, I use the following methods:
getRandomArbitrary(min, max) {
return this.numb = Math.floor(Math.random() * (max - min) + min)
},
addImage() {
let img = document.getElementById('img')
img.src = 'http://portailservices/portail/fichier.php?LI=' + this.getRandomArbitrary(20, 700);
},
My objective now is to allow visitors to upvote one of the two pictures and store their choice in the local storage to create a ranking system.
The challenge I'm facing is how to effectively store the randomly generated IDs obtained.