https://github.com/lassehaslev/vue-dropzone
https://github.com/lassehaslev/vue-dropzone
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lassehaslev/vue-dropzone
- Owner: LasseHaslev
- Created: 2016-07-07T17:55:10.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-17T21:06:20.000Z (over 9 years ago)
- Last Synced: 2025-02-05T13:18:26.342Z (over 1 year ago)
- Language: JavaScript
- Size: 27.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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).