This commit is contained in:
j3d1 2023-07-05 00:59:50 +02:00
parent e2cf04cf18
commit f7c9d1d069

View file

@ -8,7 +8,7 @@
<ul>
<img v-for="file in files" :key="file.id" :src="file.name" :alt="file.name" class="img-thumbnail">
</ul>
<legend>Files</legend>
<h4>Files</h4>
<div class="input-group">
<input type="file" class="form-control" multiple id="files">
<button class="btn btn-outline-secondary" type="button">
@ -19,7 +19,7 @@
</button>
</div>
<div class="input-group" v-if="show_camera">
<input type="file" class="form-control" accept="image/*" capture="camera" id="photos">
<input type="file" class="form-control" accept="image/*" multiple capture="camera" id="photos">
<button class="btn btn-outline-secondary" type="button">
<b-icon-trash></b-icon-trash>
</button>
@ -68,7 +68,6 @@ export default {
methods: {
...mapActions(["fetchFiles", "pushFile"]),
async uploadFiles() {
//const formData = new FormData();
const files = document.getElementById("files").files;
for (let i = 0; i < files.length; i++) {
var reader = new FileReader();
@ -96,10 +95,8 @@ export default {
});
await this.fetchFiles();
}
//console.log("formData", formData);
},
async uploadPhoto() {
//const formData = new FormData();
const files = document.getElementById("photos").files;
for (let i = 0; i < files.length; i++) {
var reader = new FileReader();
@ -127,7 +124,6 @@ export default {
});
await this.fetchFiles();
}
//console.log("formData", formData);
},
},
mounted() {