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

272
Visualizações
Deleting a Vue component dynamically

I am trying to render certain components which are present in an array using component tag of Vue js.

<div v-for="(arr, index) in compArray">
    <component v-bind:is="arr.name" :key="arr.name+index" :index="index"></component>
</div>

data() {
  compArray: [{name: "Abc"}, {name: "Xyz"}]
}

I am able to add new elements to this compArray and which will increase the components that are rendered. But when i am deleting, there is an issue with UI (data). Like, if there are 3 components and all three are having data property count.

Suppose for first element rendered this count is 4, for second it is 5 and for third it is 2. Then if i delete the second element from the compArray using slice method, data shown is still 5. In ideal case it should be 2, since middle one has been deleted.

What can be the issue behind this? Any help is appreciated

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