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

137
Views
Vue @click.stop sigue obteniendo el componente secundario

Quiero obtener los elementos secundarios del componente principal.

 <div v-on:click.stop.prevent="onClickTemplateHandler"> <div> <h3 style="">Title</h3> <p>{{ lorem }}</p> </div> </div> ... onClickTemplateHandler(e) { console.log(e) const innerHTML = e.target.innerHTML if (innerHTML) { this.value += innerHTML } }

He intentado usar .self , pero todavía quiero que se pueda hacer clic en el interior del div

Pero, cuando hago clic en el interior del div, obtengo al niño como objetivo en lugar del padre.

¿Alguna sugerencia para este?

¡Gracias!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hice alguna solución

 <div> <div class="overlay" v-on:click.stop.prevent="onClickTemplateHandler"></div> <div> <h3 style="padding: 10px;text-align: center;">Header</h3> </div> </div> ... onClickTemplateHandler(e) { const innerHTML = e.target.nextElementSibling.innerHTML if (innerHTML) { this.value += innerHTML } } ... .overlay { position: absolute; width: 100%; height: 100%; left: 0px; z-index: 2; top: 0px; cursor: pointer; }
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!