customizable-uploader
v0.0.2
Published
A file uploader regex based component.
Downloads
7
Readme
Customizable file uploadeer
This is a boostrap based file uploader that takes a regex for as the file extension you want uploaded.
Installing
npm i customizable-uploader
In your main.js, or a similar entry point for your app:
import Uploader from "customizable-uploader";
Vue.use(Uploader);
Usage
Inside your template
<form>
<div class="form-group">
<label for="file-uploader">file name here</label>
<Uploader id="file-uploader" @submittedFile="submittedFile" :regex="/\.(csv)$/i" />
</div>
</form>
export default {
name: "app",
data() {
return {
File=[]
}
}
methods: {
/**
*The uploader emits an event with the file if the regex pass
*/
submittedFile(file){
this.File=file;
}
},
};
</script>