<template>
  <div>
    <el-upload class="upload-demo" :multiple="multiple" :show-file-list="showFileList" :limit="limit" :accept="accept"
      :style="{
        'border': borderColor ? `1px dashed ${borderColor}` : 'none',
        'background-color': `${backgroundColor}`
      }" drag action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15">
      <slot />
    </el-upload>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';

const props = defineProps({
  borderColor: {
    type: String,
    default: '#ddd'
  },
  backgroundColor: {
    type: String,
    default: '#fff'
  },
  multiple: {
    type: Boolean,
    default: false
  },
  showFileList: {
    type: Boolean,
    default: false
  },
  limit: {
    type: Number,
    default: 1
  },
  accept: {
    type: String,
    default: 'img'
  }
})

</script>
<style scoped lang="scss">
.upload-demo {
  border-radius: 16px;
  transition: all 0.2s;

  &:hover {
    border-color: #5337C7;
  }

  :deep(.el-upload-dragger) {
    background-color: transparent;
    border: none;
  }

  .el-upload__text {
    color: #00000063;
  }
}
</style>