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

78
Visualizações
Problem with resize div element in grid container in Vue

I have to make resizable and draggable box in grid container. I have problem with resize box. My box is in grid cell, and it can move in grid container. I can resize, but with that resize, cell size is changing. I want to resize over grid cells. And I need to do this without using any library.

On this picture cell is resize

I want something like this.

enter image description here

<template>
  <div v-bind:class="dragAndDropContainerClass">
    <div
      v-bind:class="dragAndDropItemClass"
      v-for="n in 256"
      :key="n"
      @drop="drop"
      @dragover="allowDrop"
    >
      <div
        v-if="n === 1"
        v-bind:class="itemClass"
        v-bind:id="boxId"
        draggable="true"
        @dragstart="drag"
        v-on:click="getParentClass"
      ></div>
    </div>
  </div>
</template>
.dragAndDropContainerClass:first-child {
  background-color: blue;
}

.dragAndDropContainer {
  height: 600px;
  width: 600px;
  border: 1px solid black;
  display: grid;
  gap: 1px;
  grid-template-rows: repeat(16, 1fr);
  grid-template-columns: repeat(16, 1fr);
}

.dragAndDropItem {
  text-align: center;
  background: red;
  /* resize: both;
  overflow: auto; */
}

.item {
  content: "";
  aspect-ratio: 1 / 1;
  background-color: blue;
  grid-column: 3 / span 2;
  grid-row: third-line / 4;
  overflow: auto;
  resize: both;
}
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