<template>
<el-form-item :prop="prop" :label="label" :label-width="options.labelWidth" :rules="rules">
  <glp-file-link :data-source="value" style="min-height: 33px;" v-bind="props"></glp-file-link>
</el-form-item>
</template>

<script lang="ts">

import { Vue, Component, Prop, Ref, Watch } from 'vue-property-decorator'
import { mixins } from 'vue-class-component'
import { FileLinkOptions, FileLinkDef } from '../../type'
import FieldMixins from './FieldMixins'

@Component
export default class FileLinkControl extends mixins(FieldMixins) {
  get options () {
    return Object.assign(new FileLinkOptions(), this.def?.options)
  }

  get props () {
    return {
      props: this.options?.props,
      type: this.options?.type,
      downloadFn: this.options?.downloadFn
    }
  }

  def!: FileLinkDef
}
</script>
