Skip to content

Instantly share code, notes, and snippets.

@Thaekeh
Last active November 4, 2022 23:21
Show Gist options
  • Save Thaekeh/adca8a7611aab289a1e9ef23b0dc181b to your computer and use it in GitHub Desktop.
Save Thaekeh/adca8a7611aab289a1e9ef23b0dc181b to your computer and use it in GitHub Desktop.
Simple search by using the included() method
computed: {
searchResult() {
let tempRecipes = this.recipes
if (this.searchValue != '' && this.searchValue) {
tempRecipes = tempRecipes.filter((item) => {
return item.title
.toUpperCase()
.includes(this.searchValue.toUpperCase())
})
}
return tempRecipes
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment