Skip to content

cuulee/vue-picture-input

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-picture-input

Mobile-friendly picture file input Vue.js component with image preview and drag and drop.

Picture Input Demo

Installation

###npm

npm install --save vue-picture-input

Usage

<script>
import PictureInput from 'vue-picture-input'

export default {
  name: 'hello',
  components: {
    PictureInput
  },
  data () {
    return {
      msg: 'Just another Vue.js app'
    }
  }
}
</script>
<template>
  <div class="hello">    
    <picture-input width="600" height="600" margin="16" accept="image/jpeg,image/png"></picture-input>    
  </div>
</template>

Props

  • width, height: (pixels, optional) the width and the height of the preview container. The picture will be resized and centered to cover this area. If not specified, the preview container will expand to full width, 1:1 square ratio.
  • margin: (pixels, optional) the margin around the preview container.
  • accept: (media type, optional) the accepted image type(s) (e.g. image/jpeg, image/gif, etc.) Default value: image/*.
  • id, name: (string, optional) the id and name attributes of the HTML input element

TODOs

  • Add support for multiple files
  • Demo GitHub pages

Contributions

All contributions are welcome.

About

Mobile-friendly picture file input Vue.js component with image preview and drag and drop.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 100.0%