Last active
November 4, 2022 23:21
-
-
Save Thaekeh/adca8a7611aab289a1e9ef23b0dc181b to your computer and use it in GitHub Desktop.
Simple search by using the included() method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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