“Vuejs V-On” Kode Jawaban

v-for

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

Vuejs V-On

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

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

Vue JS Data Bind

// with v=bind
 <p><a v-bind:href="website">Text goes here fo the link </a> </p> 

//or with :
 <p><a :href="website">Text goes here fo the link </a> </p>

//website is variable/property with link in a Vue instance
Batman

Acara Vueks

<div id="example-3">
  <button v-on:click="say('salut')">Dire salut</button>
  <button v-on:click="say('quoi')">Dire quoi</button>
</div>
Fragile Fish

Acara Vueks

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

Jawaban yang mirip dengan “Vuejs V-On”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya