websanova/vue-upload

Uncaught TypeError: Cannot read property 'post' of undefined

Closed this issue ยท 3 comments

Uncaught TypeError: Cannot read property 'post' of undefined
I just want to use vue-axios, axios. but i think your package need vue-resources how to solve this?

Here 's the complete log
app.js:87580 Uncaught TypeError: Cannot read property 'post' of undefined
at Upload._http (app.js:87580)
at Upload._startFileUpload (app.js:87839)
at Upload._processQueue (app.js:87810)
at Upload._processFiles (app.js:87696)
at Upload._onFileInputChange (app.js:87605)
at HTMLInputElement.input.onchange (app.js:88079)
In this line
function _http(data) {
this.$http.post(data.url, data.body, {progress: data.progress}).then(data.success, data.error);
}

Uncaught ReferenceError: axios is not defined
I'm asking because I have tried so many things even your comment
I can use axios anywhere easily, like this.$http.post and have tried your comment also

import axios from "axios";
import VueAxios from "vue-axios";
Vue.use(VueAxios, axios)

Thank you for answering :
Vue.http = axios
I solved it