Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

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

I was wondering if there is a way to use two event parameters with v-on (@).

Ex:

<div @click:mouseover="someFunction"></div>

Instead of writing:

<div @click="someFunction" @mouseover="someFunction"></div>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

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>
about 4 years ago · Juan Pablo Isaza Report

0

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>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!