Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 806 Bytes

readme.md

File metadata and controls

36 lines (23 loc) · 806 Bytes

Photo upload component, not trying to be "reusable component". It works on its own or you can use it as a starting point.

Photo Upload

Example

Vue.component('photo-upload', require('./components/PhotoUpload.vue'));

and

<photo-upload @input="handleFileUpload" :value="value"></photo-upload>

Optional parameter disabled to enable/disable compnent.

Value is current image preview (if image is already uploaded)

Example how to upload photo, or other way is to serialize file with base64.

handleFileUpload(file){
    let form = new FormData();
    form.append('photo', file);

	// or this.$http
    axios.post(`/api/upload`, form).then(res => {
		
    }, res => {

    });
},