//In HTML
<div>
<img :src="this.dogUrl" />
</div>
<div>
<input type="file" accept="image/*" capture="camera" @change="cattura" ref="nome_foto" >
</div>
//In Methods
cattura(event){
this.selectedFile = event.target.files[0];
const fd = new FormData();
this.immagine = URL.createObjectURL(this.selectedFile)
fd.append('image', this.selectedFile, this.selectedFile.name);
this.dogUrl = this.immagine
}
Comments