[Vuejs]-New to Vue, stuck on global variable

0👍

It’s because you’re in a different scope at this point.
You can keep a reference to this though.

filteredList() {
  const vm = this; // obviously doesn't have to be called vm. Choose whatever name you like
  return cards.filter((el) => // <-- Your `this`-scope breaks here
  {
    return el.Name.toLowerCase().includes("an"); //this one works
    return el.Name.toLowerCase().includes(vm.searchInLowerCase); <-- use reference here
    return el.Name.toLowerCase().includes(vm.search); <-- and here
  })
}

Leave a comment