# 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


# Example

<file-component label="File"></file-component>
Drag a file here or browse to upload.
Last Updated: 1/13/2020, 1:30:41 PM