Style ghost, chosen, and drag elements
masterYou can customize the visual appearance of elements during the drag process by using the ghost-class, chosen-class, and drag-class props. These props allow you to apply specific CSS classes to the placeholder (ghost), the element currently selected (chosen), and the element being actively dragged (drag).
<!-- Component configuration -->
<draggable
v-model="list"
:animation="300"
easing="cubic-bezier(0.4, 0, 0.2, 1)"
ghost-class="ghost"
chosen-class="chosen"
drag-class="drag"
>
<!-- items -->
</draggable>
/* Corresponding CSS */
.ghost {
opacity: 0.5;
background: #c8ebfb;
border: 2px dashed #2196f3;
}
.chosen {
transform: rotate(5deg);
}
.drag {
transform: rotate(0deg;
}