0.1.1 • Published 6 years ago
vue-filereader v0.1.1
Vue FileReader
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