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

156
Visualizações
Emit not registering in VueJS?

I was trying to make a simple function in the parent element that updates a variable when it gets an emit from the child element. I've been stuck on it for 2 hours and I'm fed up because I know that the answer will be so simple.

Code in question:

Child element:

<div v-on:click="$emit('event1')">
      Click
</div>

Parent element:

<p @event1="test()"></p>
<Section /> // the child element

methods: {
   test() {
       console.log("test")
   },
}

The code above doesn't log anything. I've made it as minimal because no outside factor would change the outcome of the code.

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The event listener has to be attached to your <Section /> element, event1 is not emitted globally

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