Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

76
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!