I am currently working on creating a filtered list in Native Vue, specifically compiling and running it for Android.
export default {
components: { card },
data:
{
search: 'An',
level: "",
},
computed: {
searchInLowerCase()
{
return this.search.toLowerCase().trim().toString();
},
filteredList()
{
return cards.filter((el) =>
{
return el.Name.toLowerCase().includes("an"); //this one works
return el.Name.toLowerCase().includes(this.searchInLowerCase); // This doesn't work
return el.Name.toLowerCase().includes(this.search);//same
})
}
The issue I'm facing is that the "this variable" works under the filteredList function but not under the short-hand filter function. In this function, the "This" variables are undefined. Can anyone help me understand what mistake I might be making?
Thank you in advance, Erik