Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

216
Visualizações
How to get selected value with append-outer click on vue?

I have multiple cards, each one with unique IDs and tasks, as seen in the sc: Cards

How do I get the value from the card's v-select, when append-outer-icon (plus sign) is clicked?

      <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 Respostas
Responde à pergunta

0

The + element is inside v-for. That means you have access to the current object. So, if you have v-for="card in cards", you can access card.id where you initialize the click listener - @click="doStuffWithSelectedValue" ---> You can change that line to @click="doStuffWithSelectedValue(card.id)" and the use it as parameter inside method's declaration.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda