How to get the v-for index in Vue.js?

前端 未结 4 1619
情歌与酒
情歌与酒 2021-01-07 16:18

I have a Vue component like bellow:

... data(){ items:
4条回答
  •  一向
    一向 (楼主)
    2021-01-07 16:27

    Updated Answer:: You have indexed array as: "["aaaa","bbbbb"]" then you this script.

    new Vue({
      el: '#app',
      data: {
        items: ["aaaa","bbbbb"]
      }
    })
    
    
    
    {{ index }} : {{ item }}

提交回复
热议问题