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

242
Visualizações
Values are changing in loop but not passing to the function which i called in @click in vue

I've been trying to send values to a function through @click method but only the first value is passing and the other values are not passing.

<tr v-for="(m, i) in list.accounts" :key="i">
   <td class="border-top-0">
        <div class="custom-control custom-radio">
          <input
            type="radio"
            class="custom-control-input"
            name="accept_revoke"
            id="accept"
            value="1"
            :checked="list.acceptRevoke[m.id] == 1"
            @change="dialogConfirm(m.id)"
          />

          <label class="custom-control-label" for="accept">Yes ---{{m.id}}</label>
        </div>
        <div class="custom-control custom-radio">
          <input
            type="radio"
            class="custom-control-input"
            name="accept_revoke"
            id="revoke"
            value="0"
            :checked="list.acceptRevoke[m.id] == 0"
            @change="dialogConfirm(m.id)"
          />
          <label class="custom-control-label" for="revoke">No---{{m.id}}</label>
        </div>
      </td>
  </tr>

and in the above part where m.id changes for each iteration in ui but while passing the value to the dialogConfirm function it is always taking the value of list.accounts[0].id. i.e the first iteration value. i also checked the value receiving at the function dialogConfirm through console.log

dialogConfirm(id) {
  console.log("id",id)
}

Could someone help me on this, your help will be much appreciated, Thanks in adv.!!

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