Alfred-Skyblue / vue-draggable-plus

Universal Drag-and-Drop Component Supporting both Vue 3 and Vue 2
https://vue-draggable-plus.pages.dev/en/
MIT License
3k stars 128 forks source link

在ElementPlus的el-row组件上使用函数式或指令式定义多个列表拖拽会有记录已全部移出,但显示扔有一个,且还能继续拖动到其他列表中 #194

Open MonGDCH opened 14 hours ago

MonGDCH commented 14 hours ago

使用最新版本

MonGDCH commented 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 }
    }
}
MonGDCH commented 14 hours ago

使用div则正常

Alfred-Skyblue commented 14 hours ago

是否可以提供在线的复现案例?这样可以帮助我们更好的排查问题