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

87
Vistas
How to apply mouseover function to component in Svelte

I have the following elements:

Parent.svelte

<script>
    import Child from './Child.svelte';

    function handleMouse(){

    }

</script>

<Child on:mousedown={handleMouseDown} on:mouseover={handleMouse}/>

<div draggable="true" on:mousedown={handleMouseDown} on:mouseover={handleMouse}>Text</div>

Child.svelte

<div draggable="true">Child text</div>

How can I get the handleMouse() function to work on the child component, when the function is in the parent component?

I can recreate the function inside of the child component, but is there a way to just bind to the parent functions for the child element?

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

0

You can forward events from a child component by specifying on: with only the event name, e.g.

<div draggable="true" on:mousedown on:mouseover >Child text</div>
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