0.2.0 • Published 4 years ago

v-upload-base64 v0.2.0

Weekly downloads
31
License
MIT
Repository
github
Last release
4 years ago

v-upload-base64

File upload component for Vue.js

Installation

Using yarn

yarn add v-upload-base64

Using npm

npm i --save v-upload-base64

Usage

Examples

As component

<template>
  <v-upload multiple v-model="form.file" @input="file" @update="files">
    <template v-slot:default="a">
      <i @click="a.open()" class="cursor-pointer material-icons" >add_circle_outline</i>
    </template>
  </v-upload>
</template>

<script>
import VUpload from 'v-upload-base64';

export default {
  data () {
    return {
      form: {
        file: []
      }
    }
  },
  methods: {
    file (f) {
      console.log(f); // a File object or collection of File objects
    },
    files(f) {
      console.log(f); // a collection of File objects
    }
  }
}
</script>

Properties

NameTypeRequiredDefaultInfo
v-modelAnyFalse
cameraBooleanFalseFalseIf true when open on mobile devise will be open the camera, not chose a file
multipleBooleanFalseFalseIf you want to select multiple file should be true
typesStringFalse'image/*'Types for inpyt type file
clearBooleanFalseTrueClear internal container if select another file(s)
debugBooleanFalseTrueShow debug information
maxSizeNumberFalse0Max size of file for upload in 'Mb', 0 = any size
disabledBooleanFalseFalseSet true for disable ability for upload anything

Events

NameParamsInfo
inputevent: File Object or File, File,...Triggered after File readed from disk
updateevent: File, File,...Triggered after File readed from disk

Suggest

For create from base64 img src or show pdf or xls file on new browser window you can use package satellite vue-small-plugin

License

This project is licensed under MIT License

0.2.0

4 years ago

0.1.0

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago