npm.io
0.1.1 • Published 7 years ago

vue-filereader

Licence
MIT
Version
0.1.1
Deps
1
Size
102 kB
Vulns
1
Weekly
0
Stars
1

Vue FileReader Current version

Vue.js version License

Vue.js component

Install

NPM

npm i vue-filereader --save

Usage

import FileReader from 'vue-filereader'

// mount
...
components: {
  FileReader
}
...

// mount with global
Vue.component(FileReader.name, FileReader)

Default tag

<!-- 
  Output data:
  array - ArrayBuffer
  binary - BinaryString
  data - DataUrl
  text - TextString (default)
-->
<file-reader
  accept=".txt"
  output="binary"
  @reader-load="myMethod"
/>

Customization

<file-reader
  accept=".txt"
  output="binary"
  @reader-load="myMethod"
>
  <template
    #reader="props"
  >
    <input
      type="file"
      :accept="props.accept"
      @change="props.onchange"
    />
  </template>
</file-reader>

Development

Compiles and hot-reloads for development
npm run serve
Compiles and minifies for production
npm run build:lib
Lints and fixes files
npm run lint
Author

magr0s

License

MIT

Keywords