Answers for "on click vue js"

4

@keyup.enter vue

<input v-on:keyup.enter="submit">
<!-- Also works like this: -->
<input @keyup.enter="submit">
Posted by: Guest on July-16-2020
0

click vue

<button v-on:click="warn('Form cannot be submitted yet.', $event)">
  Submit
</button>



// ...
methods: {
  warn: function (message, event) {
    // now we have access to the native event
    if (event) {
      event.preventDefault()
    }
    alert(message)
  }
}
Posted by: Guest on February-13-2021
2

click in vue

<button  @click="setComponent('manage')">manage</button>
Posted by: Guest on May-29-2021
0

event vueks

<div id="example-3">
  <button v-on:click="say('salut')">Dire salut</button>
  <button v-on:click="say('quoi')">Dire quoi</button>
</div>
Posted by: Guest on November-04-2020
0

event vueks

new Vue({
  el: '#example-3',
  methods: {
    say: function (message) {
      alert(message)
    }
  }
})
Posted by: Guest on November-04-2020

Browse Popular Code Answers by Language