使用vue獲取數據時,共有7條數據,但是我只需要前兩條,怎麼處理

https://bbs.csdn.net/topics/392289820?page=1

<ul id="example">
  <li v-for="(item, index) in items" v-if='index<2'>
    {{ index }} - {{ item.message }}
  </li>
</ul>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章