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
<template> | |
<slot> | |
Backup text | |
</slot> | |
</template> |
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: { | |
sortedRecipes() { | |
tempArray = tempArray.sort((a, b) => { | |
if (a.favorite && !b.favorite) { | |
return -1 | |
} else if (!a.favorite && b.favorite) { | |
return 1 | |
} else { | |
return 0 | |
} |
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: { | |
filteredRecipes() { | |
let tempRecipes = this.recipes | |
if (this.searchValue != '' && this.searchValue) { | |
tempRecipes = tempRecipes.filter((item) => { | |
return item.title | |
.toUpperCase() | |
.includes(this.searchValue.toUpperCase()) | |
}) |
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()) | |
}) |
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: { | |
filteredRecipes() { | |
let tempRecipes = this.recipes | |
tempRecipes = tempRecipes.filter((item) => { | |
return item.favorite | |
}) | |
} | |
} |
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: { | |
filteredRecipes() { | |
let tempRecipes = this.recipes | |
tempRecipes = tempRecipes.filter((item) => { | |
return (item.cookingTime <= this.maxCookingTime) | |
}) | |
return tempRecipes; | |
} |
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: { | |
sortedArray() { | |
let sortedRecipes = this.recipes; | |
if (sortMethod == 'alphabetically' { | |
sortedRecipes = sortedRecipes.sort((a,b) => { | |
let fa = a.title.toLowerCase(), fb = b.title.toLowerCase(); | |
if (fa < fb) { | |
return -1 | |
} |
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: { | |
sortedArray() { | |
let sortedRecipes = this.recipes; | |
sortedRecipes = sortedRecipes.sort((a,b) => { | |
let fa = a.title.toLowerCase(), fb = b.title.toLowerCase(); | |
if (fa < fb) { | |
return -1 | |
} | |
if (fa > fb) { |