So i have those objects in array from an api request
(5) [{…}, {…}, {…}, {…}, {…}]
0: {ID: 1, Title: "dqdq", Description: "dqdq", IdUser: 3}
1: {ID: 2, Title: "dqdq", Description: "dqdq", IdUser: 3}
2: {ID: 3, Title: "dqdqddd", Description: "dqdq", IdUser: 3}
3: {ID: 4, Title: "dqdqddd", Description: "dqdq", IdUser: 3}
4: {ID: 5, Title: "dqdqddd", Description: "dqdq", IdUser: 3}
length: 5
what i need to have is to take just the Title so i can loop it inside a div and so on for the description and pass it to the child component so i can loop it in the html part
<template>
<div>
<Navbar />
<gamesIdeaList :games="games" />
</div>
</template>
<script>
// @ is an alias to /src
import Navbar from '@/components/Navbar.vue'
import gamesIdeaList from '@/components/gamesIdeaList.vue'
import axios from 'axios'
export default {
name: 'home',
components: {
Navbar,
gamesIdeaList
},
data() {
return {
games:[]
}
},
// props: info,
mounted () {
axios.get('http://localhost:3001/GamesIdea', {
headers: { Authorization: `Bearer ${localStorage.usertoken}` }
})
.then(res => {
this.games = res.data.data
console.log(arr)
})
.catch(error => {
console.log(error)
this.errored = true
})
}
}
</script>