vue-resource

mounted(){
this.retData(1)
},
methods:{
retData(aid){
var that = this;
var api='http://xxxxxxx';
this.$http.get(api).then((response)=>{
that.li=response.body.result;
console.log(response.body.result)
},(err)=>{
console.log(err)
})
}
}


import VueResource from 'vue-resource';
Vue.use(VueResource);
main.js

 

posted @ 2018-06-20 17:08  昂达达  阅读(141)  评论(0编辑  收藏  举报