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

224
Views
¿Cómo obtener el valor seleccionado con un clic externo adjunto en vue?

Tengo varias tarjetas, cada una con identificaciones y tareas únicas, como se ve en el sc: Tarjetas

¿Cómo obtengo el valor de la selección en V de la tarjeta, cuando se hace clic en el ícono externo (signo más)?

 <v-container fluid> <v-row dense align="center" justify="center"> <v-col cols="2" v-for="card in cards" :key="card.id"> <v-card class="mx-auto"> <v-card-title> {{ card.name }} </v-card-title> <v-card-subtitle> {{ card.id }} </v-card-subtitle> <v-card-actions> <v-select :items="items" item-text="name" item-value="value" label="Do stuff" dense outlined prepend-inner-icon="fa-file" append-outer-icon="fa-plus" @click:append-outer="doStuffWithSelectedValue" // do stuff with value from parent v-select ></v-select> </v-card-actions> </v-card> </v-col> </v-row> </v-container>
 methods: { doStuffWithSelectedValue(s) { // how do I know which v-select icon was clicked and it's value? }, }, data() { return { items: [ { name: "Do first task", value: "FIRST_ITEM" }, ], cards: [ { dateCreated: "2022-02-02T14:21:37.543Z", name: "First card", id: "FIRST_CARD_ID", }, ], }; },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El elemento + está dentro de v-for. Eso significa que tiene acceso al objeto actual. Entonces, si tiene v-for="card in cards", puede acceder a card.id donde inicializa el detector de clics - @click="doStuffWithSelectedValue" ---> Puede cambiar esa línea a @click="doStuffWithSelectedValue( card.id)" y usarlo como parámetro dentro de la declaración del método.

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!