Answer the question
In order to leave comments, you need to log in
Why is the click not working?
<div class="container__wrap" id="app">
<div class="header">
<input type="file" v-model="file" class="" id="file" ref="file">
<a class="button" v-on:click="submitFile">Отправить </a>
</div>
<div class="container">
<div class="slider" id="s-1"></div>
<div class="slider" id="s-2"></div>
<div class="slider" id="s-3"></div>
<div class="slider" id="s-4"></div>
<div class="slider" id="s-5"></div>
</div>
</div>
var app = new Vue({
el: '#app',
data() {
return {
file: '',
text: 'ww',
seen: true,
}
},
methods: {
submitFile() {
console.log('Отправляем');
let formData = new FormData();
formData.append('file', this.file);
axios.post('/vendor/FileController',
formData,
{
headers: {
'Content-Type': 'multipart/form-data'
}
}
).then(function () {
console.log('SUCCESS!!');
})
.catch(function () {
console.log('FAILURE!!');
});
},
handleFileUpload() {
this.file = this.$refs.file.files[0];
}
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question