<template>
  <draggable
    :sort="true"
    @start="onStart"
    @end="onEnd"
    v-bind="$attrs"
    v-on="$listeners"
  >
    <transition-group class="draggable-group">
      <slot />
    </transition-group>
  </draggable>
</template>

<script>
import Draggable from 'vuedraggable';

export default {
  name: 'AdbDraggable',
  components: { Draggable },
  data() {
    return {
      drag: false,
    };
  },
  methods: {
    // 开始拖拽事件
    onStart() {
      this.drag = true;
    },
    // 拖拽结束事件
    onEnd() {
      this.drag = false;
    },
  },
};
</script>
