Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

183
Vistas
How do I clone a mouseevent for $emit in vue

I am trying to

  • emit an event from a vue2 component
  • have the event reflect exactly the native mouse event happening in the component
  • and have two fields added - canvasX and canvasX

I tried adding the fields like this:

evt.canvasX = x;
evt.canvasY = y;

and emitting like this:

this.$emit('mouseup', evt)

but in the handler in the outer component there is no trace of canvasX and canvasX

Barring copying all properties one by one - is there a way to extend the event with new properties?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could try creating a new event data object which inherits properties from the original event.

this.$emit('mouseup', { ...evt, canvasX: x, canvasY: y })
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda