<script setup lang="ts">

import {dragNodes} from "./configs";
import { VueDraggable } from 'vue-draggable-plus'

import useDragAndDrop from '../../hooks/useDnD'

const { onDragStart } = useDragAndDrop()
</script>

<template>
<div class="drag-container" >
  <div class="drag-item" v-for="(dragData, index) in dragNodes" :key="index" v-text="dragData.data.label" :draggable="true" @dragstart="onDragStart($event, dragData)" />

</div>
</template>

<style scoped lang="less">
.drag-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  height: 100%;
  width: 200px;
  background: #ccc;
  padding: 8px 10px;
  .drag-item {
    background: #fff;
    width: 100%;
    font-size: 14px;
    text-align: center;
    height: 20px;
    line-height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(204, 204, 204, 0.9);
    margin-bottom: 10px;
    cursor: pointer;
  }
}
</style>
