Answer the question
In order to leave comments, you need to log in
How to limit the output of a list in vuejs, for example 5th or 10th and so on?
There is a design, it displays a preview of the user's avatars:
<div class="conteaner-drop">
<router-link :to="`/drop${ user.drop }`" class="drop-preview" v-for="user in randomList" :key="user">
<img :src="require(`@/assets/images/dropuser/drop${ user.drop }/${ user.avatar }.jpg`)" />
<div class="pfilter"></div>
<span :class="user.status"></span>
<p>{{ user.name }}</p>
</router-link>
</div>
computed: {
randomList: function(){
return this.users.sort(function(){return 0.5 - Math.random()});
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question