<template>
  <el-popover v-model="visible" trigger="manual">
    <div style="margin-bottom:5px;">
      <span style="font-size:16px;">附件列表</span>
      <i class="el-icon-circle-close" style="float:right;cursor:pointer;margin-top:2px;" @click="visible = false" />
    </div>
    <attachment-table :list="list" />
    <el-button v-if="list.length > 0" slot="reference" type="text" size="mini" @click="visible = !visible">[{{ list.length }}个附件]</el-button>
  </el-popover>
</template>

<script>
import AttachmentTable from '@/components/Attachment/AttachmentTable'
export default {
  components: { AttachmentTable },
  props: {
    list: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      visible: false
    }
  }
}
</script>
