Open MonGDCH opened 14 hours ago
<template>
<el-row class="w-full" style="min-height: 120px;" ref="row-draggable">
<el-col class="relative" :span="24" v-for="(e) in list" :key="e.key">
<div>{{ e.key }}</div>
</el-col>
</el-row>
</template>
<script>
import { ref, computed, watch, useTemplateRef, onMounted } from 'vue';
import { VueDraggable, vDraggable, useDraggable } from 'vue-draggable-plus'
export default {
name: 'Widget-item',
components: { ItemView, VueDraggable },
setup(props, { emit }) {
const list = ref([
{
key: 'item 1',
componentConfig: {}
},
{
key: 'item 3',
componentConfig: {}
},
{
key: 'item 2',
componentConfig: {}
},
{
key: 'item 4',
componentConfig: {}
},
{
key: 'item 6',
componentConfig: {}
},
{
key: 'item 7',
componentConfig: {}
}
])
const rowRef = useTemplateRef('row-draggable')
useDraggable(rowRef, list, {
group: 'widget', ghostClass: 'clone', animation: '200'
})
return { list }
}
}
使用div则正常
是否可以提供在线的复现案例?这样可以帮助我们更好的排查问题
使用最新版本