# File
# Usage
// Global installation
import FileInstaller from "vue-elder-file";
//...
Vue.use(FileInstaller);
// Local installation
import { FileComponent, setup } from "vue-elder-file";
setup({
//Options
upload(file, onProgress, options) {
/*
Write your custom upload function
Call "onProgress" with a value (0-100) to change the progress
"options" is whatever has been set as uploadOptions prop
*/
},
serialize(val) {
/*
Transform value
Expected format:
/* Value format
{
name: '...',
url: '...',
size: ...,
type: '...'
}
*/
},
dropMessage: "Drag a file here or <b>browse</b> to upload.",
nofilesMessage: "-",
icons: [{ pattern: /text.*/, icon: "file-alt" }]
});
//...
components: {
FileComponent;
}
# Slots
- drop-message
# Props
- value
Array | Object | String
- label
String
- sortable
Boolean
- multiple
Boolean
- rename
String | Boolean
- upload
Function
- serialize
Function
- uploadOptions
Object
# Example
<file-component label="File"></file-component>
Drag a file here or browse to upload.