new Vue({ el: '#app', data () { return { info: null } }, mounted () { axios .get('https://api.coindesk.com/v1/bpi/currentprice.json') .then(response => (this.info = response)) } })
<ul> <li v-for="food in foods"> <h2>{{food.name}}</h2> <ul> <li v-for="nutrient in food.nutrients">{{nutrient.nutrient_id}}</li> </ul> </li> </ul> axios.get(url).then(response => { this.foods = response.data.report.foods })
vue get data from backend