<script type="text/javascript">
var vm = new Vue({
el:'#app',
data:{
msg:'hello world'
},
methods:{
getInfo(){
this.$http.jsonp('http://api.vue-tp5.com/v1/index/index').then(function(result){
console.log(result)
}).catch(function(error){
console.log(error);
});
}
}
});
</script>
在then后加上catch即可