http common axios vue js code example
Example 1: vuejs list items from axios
-
{{food.name}}
- {{nutrient.nutrient_id}}
axios.get(url).then(response => {
this.foods = response.data.report.foods
})
Example 2: import api vue and html
new Vue({
el: '#app',
data () {
return {
info: null
}
},
mounted () {
axios
.get('https://api.coindesk.com/v1/bpi/currentprice.json')
.then(response => (this.info = response))
}
})