I want to get a random value in a v-for loop to make a slideshow of articles. I would like to replace my randomGen computed function into a random post generator without being twice the same. full app : https://jsfiddle.net/z7sfm5tq/ I've already done this :
<div class="article-ran">
<div class="bloc" v-for="post in randomGen">
<img v-bind:src="post.img"/>
<span>{{ post.cat }}</span>
<p v-bind:href="post.link" target="_blank">
{{ post.title }}
</p>
</div>
and my vuejs app
computed: {
randomGen(){
Math.floor(Math.random() * this.postList.length);
this.pickerList = this.postList;
//so this is the randomGen function that's not working
}
}
})