[Vuejs]-Is there a way to use two (or more) event parameters in Vue with v-on (@)?

2👍

No, it’s not possible, each event is handled separately, but there’s another syntax which handle the events with object syntax :

<div @="{click:someFunction, mouseover:someFunction}"></div>

2👍

No, each event should be specified one way or another.

You could bind them via an object if you want less bloat in your template.

psudo code:

<template>
  <div v-on="handlers" />
</template>

<script>
...
data() {
  return {
    handlers: {
      'click': func,
      'mouseover': func,
       ...
    }
  }
}
...
</script>

Leave a comment