已经安装axios并且在入口文件引入了
我在组件里面下面这样写的 可是报了这个错误
一开始时我写的不是this.axios而是axios 但是这样写提示axios未定义 可是我在入口文件已经引入了啊 后来才改成的下面的写法 但是还是报错 这是为什么?第一次用axios
created () {
this.axios.get('http://api.douban.com/v2/movie/in_theaters')
.then(function (response) {
console.log(response)
})
.catch(function (response) {
console.log(response)
})
}
你这样 this.$http.get().then(function(res){
}
上面都已经写了Vue.prototype.$http = axios 为啥还要用this.axios.get呢