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

107
Views
Los parámetros de Vue no están definidos cuando se emiten de padre a hijo

Puedo obtener accesorios para emitir de padre a hijo usando este método:

 // CHILD COMPONENT methods: { toggleClassification: function(classification, level) { // Check if requested classification is already set if(this.classifications[level]) return; // Reset classifications for(let i = 0; i < 4; i++){ if(this.classifications[i]) { this.classifications[i] = false; break; } } // classification is defined at this point this.$emit("ChangeClassification", classification); ... },
 // PARENT COMPONENT (Working) <div> ... <ClassificationBar @ChangeClassification="changeClassification" :classification="overallClassification"/> ... </div> methods: { changeClassification(classification) { // classification is defined here console.log(classification); },

Sin embargo, hay varias barras de clasificación, por lo que quiero asociar la clasificación con la fuente del cambio. Hay múltiples barras de clasificación en la pantalla y debe saber de qué div proviene. ¿Hay alguna manera de que pueda lograr esto?

 // PARENT COMPONENT (Not Working) <div> ... // tried passing parameter "overall" as the source of the change <ClassificationBar @ChangeClassification="changeClassification(classification, 'overall')" :classification="overallClassification"/> ... </div> methods: { changeClassification(classification, source) { // classification is not defined but the source is console.log(classification, source); },

Parece que una vez que agrego parámetros a la función "cambiarClasificación", la clasificación ya no está definida. Cualquier ayuda en esto sería muy apreciada.

about 4 years ago · Juan Pablo Isaza
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!