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

531
Views
(Vuejs) La propiedad o el método no está definido en la instancia, pero se hace referencia durante el procesamiento

Tengo un botón simple, supongo que para agregar un elemento en una lista:

 <label for="numit">item number:</label> <input type="text" id="numit" :value="idxItemBuy"> <button id="buyitem" @click="buy($event.target.value)">Buy</button>
 buy() { console.log("buy fonction") this.currentPlayer.buy(this.idxItemBuy) }

pero en realidad no está llamando al método comprar (y no sé cuándo se supone que debo usar $event.target.value)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede leer más sobre v-model => enlazar entrada con datos ( https://vuejs.org/v2/guide/forms.html o https://v3.vuejs.org/guide/forms.html#text )

Te escribo un código que funciona.

 <template> <div> <label>item number:</label> <input type="text" v-model="idxItemBuy" /> <button @click="buy">Buy</button> <ul> <li v-for="item in items" :key="item"> {{ item }} </li> </ul> </div> </template> <script> export default { data() { return { idxItemBuy: "", items: [], }; }, methods: { buy() { console.log("buy fonction", this.idxItemBuy); this.items.push(this.idxItemBuy); }, }, }; </script>
over 4 years ago · Santiago Trujillo 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!