vue3中vue-draggable实现图片拖拽
Vue.Draggable
SortableJS/Vue.Draggable: Vue.Draggable 是 Sortable.js 的 Vue.js 封装组件,提供了拖放排序功能,可以在 Vue 应用中轻松实现列表元素的可拖拽重排。
项目地址:https://gitcode.com/gh_mirrors/vu/Vue.Draggable
·
版本 “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;
}

SortableJS/Vue.Draggable: Vue.Draggable 是 Sortable.js 的 Vue.js 封装组件,提供了拖放排序功能,可以在 Vue 应用中轻松实现列表元素的可拖拽重排。
最近提交(Master分支:3 个月前 )
431db153 - 2 年前
017ab498 - 3 年前
更多推荐

所有评论(0)