Currently, I have this specific code in my HTML file that utilizes a v-for loop to iterate over an array. For each entry, it calls a method with a parameter using a v-if directive to display the option tag only if the method evaluates to true.
Below is the snippet of the HTML code:
<template v-for="a in agencies">
<option v-if="agencyCk(a) === true" :value="a">${a}</option>
</template>
Here is the function defined in the Vue script section:
agencyCk: function(agency) {
// Check object keys for matching name
if (Object.keys(st.fullAgency).find(function(k) {
// If name matches agency
if (k === agency) {
var obj = st.fullAgency[k];
// Loop through an array for each value
for (h in st.hosts) {
// If value matches object key's value
if (link === st.hosts[h]) {
return true;
} else {
return false;
}
}
}
}));
}
However, the current issue is that it seems to be returning all values as false.