[Vuejs]-Vue js state based logic for multiple ul li elements

0๐Ÿ‘

โœ…

new Vue({
  el: '#test',
  data: {
    array: ['a', 'b', 'c', 'd'],
    myObject: {
      A: 'a',
      B: 'b',
      C: 'c'
    }
  }
});
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<div id="test">
  <ul>
    <li v-for="(item, indice) in array">{{item}} - {{indice}}</li>
  </ul>

  <ul>
    <li v-for="(item, cle, indice) in myObject">{{cle}} : {{item}} - {{indice}}</li>
  </ul>

</div>

Leave a comment