directive: v-for with parameter

by edith_tang

HTML

<div id="app">
  <ul>
  <!-- 

  -->
    <li v-for="(book, index) in books">{{ index + 1 }} - {{ book.name }}</li>
  </ul>
</div>

JavaScript

var app = new Vue({
	el: '#app',
  data: {
  	books: [
    	{ name: 'Love in the time of cholera'},
      { name: 'Wuthering Heights' },
      { name: 'Becoming' }
    ]
  }
})