Skip to content

Instantly share code, notes, and snippets.

@fazlurr
Created October 2, 2019 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fazlurr/e700a72437e0c679930dd3980694db1c to your computer and use it in GitHub Desktop.
Save fazlurr/e700a72437e0c679930dd3980694db1c to your computer and use it in GitHub Desktop.
<draggable
v-model="product.images"
v-bind="dragOptions"
@start="drag = true"
@end="drag = false">
<transition-group
class="row small-gutter"
type="transition"
:name="!drag ? 'flip-list' : null">
<div class="col" v-for="(image, index) in product.images" :key="index + 0">
<div class="pc-image draggable" :class="{ 'is-loading': image === '' }">
<div class="img" :style="{ backgroundImage: `url('${image}')` }"></div>
<i class="material-icons" v-tooltip="'Remove'" @click="removeProductImages(index)">close</i>
</div>
</div>
</transition-group>
</draggable>
.flip-list-move {
transition: transform 0.2s;
}
.no-move {
transition: transform 0;
}
.sortable-ghost {
opacity: 0.5;
background: #c8ebfb;
}
.draggable {
cursor: move;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment