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

146
Views
¿Cómo recibir datos en el componente raíz con el método?

Quiero entender cómo funciona Vue. Lo que intento hacer es simplemente recibir el número '1' con el método en Vue. La ejecución del código me da 'indefinido'. ¿Por qué?

 <div id="form"> <button v-on:click="submitProduct">Save</button> </div> <script> var someForm = Vue.createApp ({ methods: { submitBtn: function(){ someForm.showdata }, showData: function(){ return 1 } } }) </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Intente asignar los datos devueltos a una variable y luego muéstrelos usando alert o console.log y use this en lugar de someForm :

 var someForm = Vue.createApp ({ methods: { submitBtn: function(){ let data= this.showData(); alert(data); }, showData: function(){ return 1 } } })
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!