Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement