<template>
  <div>
    <q-btn
      @click="$refs.label.click()"
      flat
      dense
      color="primary"
      label="Прикрепить файлы"
      icon="la la-paperclip"
    />
    <label ref="label" v-show="false">
      <input @change="change" type="file" multiple />
    </label>
  </div>
</template>

<script lang="ts">
import { Component, Emit, Vue } from 'vue-property-decorator'
import { QBtn } from 'quasar'

@Component({ components: { QBtn } })
export default class FileAttachBtn extends Vue {
  @Emit()
  change(event: Event & { target: HTMLInputElement }) {
    return Array.from(event.target.files || [])
  }
}
</script>
