An open API service indexing awesome lists of open source software.

https://github.com/lassehaslev/vue-dropzone


https://github.com/lassehaslev/vue-dropzone

Last synced: 24 days ago
JSON representation

Awesome Lists containing this project

README

          

# @lassehaslev/vue-dropzone
> Drop upload with Vue2

## Install
Run ```npm install @lassehaslev/vue-dropzone --save``` in your project folder

## Usage
```js
import {Dropzone} from '@lassehaslev/vue-dropzone';
export default {
template: `


Normal dropzone



 



{{ file.name }}


`,

data() {
return {
color: '#FF0000',
files: [],
}
},

methods: {
onStateChanged( enter ) {
this.color = enter ? '#0000FF' : '#FF0000';
},
onUpload( file ) {
this.files.push( file );
},
onError( response ) {
console.log('Error');
console.log(response);
},
},

components: {
Dropzone,
},
}
```

#### Build your own
```js
import BaseDropzone from './BaseDropzone';
export default {
template: `







`,
mixins: [ BaseDropzone ],
}
```

## Development

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build
```

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).