[images] ImageWidget make draggable

This commit is contained in:
Avris 2021-01-07 23:18:33 +01:00
parent 28b77474cb
commit 77e5a828e1
1 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="form-group"> <div class="form-group">
<ul class="list-unstyled"> <draggable tag="ul" v-model="images" handle="img" ghostClass="ghost" @end="$emit('input', images)" class="list-unstyled">
<li v-for="image in images" class="mb-4"> <li v-for="image in images" class="mb-4">
<ImageThumb :id="image"/> <ImageThumb :id="image"/>
<a href="#" @click.prevent="removeFile(image)" class="small"> <a href="#" @click.prevent="removeFile(image)" class="small">
@ -8,13 +8,18 @@
<T>crud.remove</T> <T>crud.remove</T>
</a> </a>
</li> </li>
</ul> </draggable>
<ImageUploader :multiple="multiple" :name="name" @uploaded="addFiles"/> <ImageUploader :multiple="multiple" :name="name" @uploaded="addFiles"/>
</div> </div>
</template> </template>
<script> <script>
import draggable from 'vuedraggable'
export default { export default {
components: {
draggable,
},
props: { props: {
value: {}, value: {},
multiple: {type: Boolean}, multiple: {type: Boolean},