javascript - Limit the number of items in vue list rendering
仅有的幸福
仅有的幸福 2017-07-05 10:49:19
0
2
1013

How to limit rendering to only 2 pieces of data?

<ul>
    <li v-for="i in data" v-text="i"></li>
</ul>

data: ['a','b','c','d']
仅有的幸福
仅有的幸福

reply all(2)
女神的闺蜜爱上我
<ul>
    <li v-for="(i, index) in data" v-if="index < 2" v-text="i"></li>
</ul>
漂亮男人

<ul>

<li v-for="i in data.slice(0, 2)" v-text="i"></li>

</ul>

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template