Answer the question
In order to leave comments, you need to log in
How to make axios work?
Hello!
I'm trying to include axsios in vue.
connection string import axios from 'axios'
new instance property Vue.prototype.$http = axios
in components request: works, but there is no
file code this.$http.get(bla bla bla)
in the js file located in the folder
import Vue from 'vue'
export default {
getContacts (fn) {
console.log(Vue.http)
Vue.http.get('http://demo.fdlfk.com/users')
debugger
// .then(data => {
// if (data) {
// fn(data)
// }
// })
}
}
Answer the question
In order to leave comments, you need to log in
Vue.prototype.$http = axios;
export default {
getContacts (fn) {
this.$http.get('http://demo.fdlfk.com/users')
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question