在采用vue-cli Post Get

需要依赖插件

vue-resource

npm install vue-resource --save

https://cn.vuejs.org/v2/cookbook/using-axios-to-consume-apis.html

采用axios一样可以取数值

new Vue({ el: '#app', data () { return { info: null } }, mounted () { axios .get('https://api.coindesk.com/v1/bpi/currentprice.json') .then(response => (this.info = response)) } })

原文地址:https://www.cnblogs.com/JamyWong/p/10396547.html