Skip to content

Instantly share code, notes, and snippets.

@Thaekeh
Last active December 2, 2020 12:51
Show Gist options
  • Save Thaekeh/509f789b911ad9a744c56b5c506e8197 to your computer and use it in GitHub Desktop.
Save Thaekeh/509f789b911ad9a744c56b5c506e8197 to your computer and use it in GitHub Desktop.
With this code you can filter an array based on the cooking time.
computed: {
filteredRecipes() {
let tempRecipes = this.recipes
tempRecipes = tempRecipes.filter((item) => {
return (item.cookingTime <= this.maxCookingTime)
})
return tempRecipes;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment