I'm trying to make a small webpage and use Airtable as a database. My base includes a few fields. The most important are "name" and "icon_png" I use vue.js, log in via axios and get all database in one array, named items. When I want to list names I can do in on html-side using <... v-for="item in items">, but it's only rendering.
Now I need pass all names as one variable to a child component via "props". How I can manipulate with arrays and send names from array "items" to array e.g. "names"?
P.S.Later I also have to put all images in a separated array for another component.
Here is my code for JS. And I have no idea, how to put names in "names"
const app = new Vue({
el: '#wrapper',
data: {
items: [],
names:[],
},
methods: {
loadItems: function(){
var self = this
var app_id = "MY_ID";
var app_key = "MY_KEY";
this.items = []
axios.get("https://api.airtable.com/v0/" + app_id + "/MY_BASE/?view=webpage",
{
headers: { Authorization: "Bearer "+app_key }
}
).then(function(response){
self.items = response.data.records
}).catch(function(error){
console.log(error)
})
},
},
mounted(){
this.loadItems();
},
})