Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

89
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda