I've got one that I'm not getting too much traction on, Ive got everything working correctly except one element. Essentially I want to filter a return of "ev3_4" in the code. I'm not sure of the correct function. I'm pulling from an external source to get the data. and the info is inside a nested array of the array that I have been able to correctly return.
<template>
<!-- the array for the ev data -->
<div id="ev-deck" class="content">
<div id="text-box-ev" class="field">
<div class="control">
<!-- To change the number of events shown change the value for X in v-for="item in infodata.slice(0, X), this is the limiter for how many will loop before it stops -->
<div class="card-content has-background-dark has-text-light" id="ev-card" v-for="item in p3data.slice(0, 2)" :key="item.infodata">
<!-- Every row is a separate line in the event element and its position is manipulated by the column css -->
<div class="row">
<div id="ev-title" class="column"> <b>ev1:</b> {{ item.ev1 (firstname) }}</div>
<div id="ev-title" class="column"><b>ev2:</b> {{ item.ev2 (lastname)}}</div>
<div id="ev-title" class="column"><b>ev3:</b> {{ item.ev3_4 (city)}}</div>
</div>
<div class="row">
<div id="ev-title" class="column"><b>ev4:</b> {{ item.ev4 }}</div>
<div id="ev-title" class="column"><b>ev5:</b> {{ item.ev5 }}</div>
</div>
<div class="row">
<div id="ev-title" class="column-centered"><b>ev6:</b> {{ item.ev6 }}</div>
</div>
<div class="row">
<div id="ev-title" class="column-centered"><b>ev7:</b> {{ item.ev7 }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ev',
}
data() {
return {
infodata: [],
},
// I know this is wrong and need help making this logic correct
item.ev3.filter(data => {
return data.ev3 === item.ev3_4
})
},
created() {
var info = 'some url'
axios.get(info)
.then( response => {
this.infodata = response.data;
console.log(response.data);
})
},
</script>
Here is an example of the the array its pulling
(infodata Array)
0:
ev1 (first name): joe
ev2 (lastname): blow
ev3 (address):
0:
ev3_1 (street number): 1234
ev3_2 (street name): main
ev3_3 (zip code): 12345
ev3_4 (city): tempe