vue使用resource发送ajax请求

  <script type="text/javascript">
new Vue({
el:'#app',
created:function(){
var url="a.json";
this.$http.get(url).then(function(data){
var json=data.body;
this.$set('json',data.data);
// console.table(json)
},function(response){
console.info(response);
if(response){
alert('e')
}
})
}
});
</script>
posted @ 2017-01-09 17:15  睡一天  阅读(2416)  评论(0)    收藏  举报