版本 “vuedraggable”: “^4.1.0”, vue3使用
import draggable from ‘vuedraggable’
components: {
draggable
},

 <draggable v-model="goodsMd4ImageArr"  item-key="index" @start="drag = true" @end="drag = false" :animation="100" class="list-group" ghost-class="ghost" :move="checkMove">
                            <template #item="{ element,index }">
                                <div class="imgLeft">
                                    <img :src="element.goods_image" alt="" style="width:150px;height:150px;" />
                                    <div class="dialogOpactiy">
                                        <div class="iconName zoomName" @click="zoomMd4Image(index)">
                                            <el-icon>
                                                <ZoomIn />
                                            </el-icon>
                                        </div>
                                        <div class="iconName" @click="delMd4Image(index)">
                                            <el-icon>
                                                <Delete />
                                            </el-icon>
                                        </div>
                                    </div>
                                </div>
                            </template>

                        </draggable>
 .list-group {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      width: 100%;
      cursor: move;
   }

在这里插入图片描述

GitHub 加速计划 / vu / Vue.Draggable
19.97 K
2.89 K
下载
SortableJS/Vue.Draggable: Vue.Draggable 是 Sortable.js 的 Vue.js 封装组件,提供了拖放排序功能,可以在 Vue 应用中轻松实现列表元素的可拖拽重排。
最近提交(Master分支:3 个月前 )
431db153 - 2 年前
017ab498 - 3 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐