vue js key code example

Example 1: vue for loop

<ul id="v-for-object" class="demo">
  <li v-for="value in object">
    {{ value }} 
  </li>
</ul>

Example 2: v-for

<ul>
  <li v-for="(item, index) in items">
    {{ index }} - {{ item }}
  </li>
</ul>

Example 3: vue js v-for array index

<ul>
  <li v-for="(val, index) in arr">
    <!-- Do something... -->
  </li>
</ul>

Example 4: event vueks

new Vue({
  el: '#example-3',
  methods: {
    say: function (message) {
      alert(message)
    }
  }
})

Example 5: vuejs v-on

<div v-on:javascriptEvent = "method"></div>

<!-- v-on:click <=> @click -->

Tags:

Html Example