Vue-simple-file-picker is a vuejs component that allows you to retrieve images (url and base64) from the user.
Use the package manager npm to install Vue-simple-file-picker.
npm install --save vue-simple-file-picker
import Vue from "vue";
import vue-simple-file-picker from 'vue-simple-file-picker'
Vue.use(vue-simple-file-picker);
<template>
<vue-simple-file-picker
:height="150"
:width="150"
:bgColor="#fff"
@data="getFileData"
/>
</template>
<script>
export default {
methods: {
getFileData(data){
console.log(data.url) //the file url
console.log(data.file) //the file in base64
}
}
};
</script>
The height of component in px.
The width of component in px.
The background color of component.
true if the component takes the full height of the parent.
true if the component takes the full width of the parent.
function to receive file data
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.