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

100
Visualizações
Page doesnt respond when many components are rendered and vue devtools is open

The component has a <select> tag, changing the value of which changes another component using v-for:

<template>
  <div class="game-board">
    <div class="minesweeper-grid"
      :style="{
         width: gridStyleSize,
         height: gridStyleSize,
         fontSize: difficulty.fontSize
      }"
    >
      <div class="cells">
         <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
        <Cell v-for="i in gridSize" :key="Math.random() + i"
            :style="{
               width: difficulty.cellSize + 'px',
               height: difficulty.cellSize + 'px',
            }"
        />
      </div>
    </div>
  </div>
</template>

<script>
import Cell from './Cell.vue'
export default {
   name: 'Game Board',
   components: { Cell },
   props: {
      difficulty: {type: Object, required: true}, // changes when the value in select changes
   },
   computed: {
      gridSize() {
         return Math.pow(this.difficulty.size, 2)
      },
      gridStyleSize() {
         const { size, cellSize } = this.difficulty
         const borderWidth = 20
         return `${size * cellSize + borderWidth}px`
      }
   },
};
</script>

Video preview

Experimentally, I found out with the help of console.log() that in each component Cell.vue calls mounted() lifecycle hook, but the page just doesn't respond, even the css hover on the element.

The page freezes only when I open vue-devtools. However, after a certain period of time, everything is rendered again, until the next change in <select>

There is no such problem on vue 2

Vue 3, Vue Devtools 6.0.12

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