<template>
    <div class="ht-base-upload-horizontal-list-demo">
        <ht-base-upload
                name="file"
                horizontal-list
                :multiple="true"
                action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                :headers="headers"
                :max-size="20480"
                :on-exceeded-size="handleMaxSize">
            <ht-base-button type="dashed" icon="LiRa_upload">上传文件</ht-base-button>
        </ht-base-upload>
        <span class="demo-upload-tip">支持word、excel、pdf文件格式，大小不超过20MB</span>
    </div>
</template>

<script>
  export default {
    name: 'HtBaseUploadHorizontalListDemo',
      data() {
          return {
              headers: {
                  authorization: 'authorization-text',
              },
          }
      },
      methods: {
          handleMaxSize() {
              this.$HtBaseMessage.error('文件大小不超过20MB！')
          }
      }
  }
</script>
<style lang="less">
    .ht-base-upload-horizontal-list-demo {
        position: relative;
        .demo-upload-tip {
            position: absolute;
            top: 14px;
            left: 114px;
        }
    }
</style>

