vuejs list items from axios
//Install Axios from terminal
npm install axios
//Import Axios in your HelloWorld.vue
import axios from 'axios'
//Add a method to implement Axios
test () {
axios.post('URL')
.then(function (response) {
alert (response.data);
})
.catch(function (error) {
alert(error);
});
}<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
}) <a :href="post.url" target="_blank"><img :src="post.image_url"></a>
Also in JavaScript:
- react grid
- funciones invocan a funciones javascript
- discord.js listen for message
- javascript round up
- js array delete specific element
- delete folder with deno
- parameters types in javascript
- scroll jquery to anchor
- vuex.esm.js
- settimeout node js
- javascript reverse each string element in array
- jquery slideup
- extract all link with javascript
- how to make ajax request javascript
- javascript new date undefined
- $.notify is not a function angular
- collapse vscode key
- save action hide element in jquery
- python save list to json
- python json change line
- ExoPlayer with auto linking react native
- jsx .style on hover react
- js for of loop
- svn node remains in conflict