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

123
Visualizações
When list rendering a component, nested component data doesn't update

The list rendering on the parent component runs perfectly

<stock-card
            class="col-sm"
            v-for="(stock, index) in formattedStocks"
            :stock="stock"
            :key="index"
          >
</stock-card>

On the nested component it only renders the first instance of the loop inside the modal component

<p class="card-text text-success">{{ stock["name"] }}$</p>
<button
  class="btn btn-danger rounded-pill"
  data-bs-toggle="modal"
  data-bs-target="#exampleModal"
  @click="buyStock(stock)"
>
  Activate Modal
</button>
<modal :modalTitle="stock['name']" />

I do have props on the both components

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The problem is with the way modal was used.

Generally, bootstrap modal is opened using data-bs-toggle="modal" and data-bs-target="modalInfo" attributes. data-bs-target is connected with id="modalInfo" in order to open and close the model.

In your case, for all three has the same data-bs-target and id, hence it was showing the same first modal in all the cases.

Here is the working example: Codesandbox

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