mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-17 07:45:36 -05:00
feature/new-feature-cleanup (#389)
* add json editor to theme editor * add toolbars tools to recipe sections * fix recipe yield * add updated_date to recipe schema * update time cards * fix mobile buttons * fix asset URL * fix PG errors CRUD * remove -d from docker-pro * fix theme tests * remvoe old typing * abstract count function Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
@@ -5,9 +5,8 @@
|
||||
title-icon=""
|
||||
:sortable="true"
|
||||
:title="$t('page.all-recipes')"
|
||||
:recipes="allRecipes"
|
||||
@sort="sortAZ"
|
||||
@sort-recent="sortRecent"
|
||||
:recipes="shownRecipes"
|
||||
@sort="assignSorted"
|
||||
/>
|
||||
</v-container>
|
||||
</template>
|
||||
@@ -22,6 +21,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
sortedResults: [],
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
@@ -35,13 +35,17 @@ export default {
|
||||
allRecipes() {
|
||||
return this.$store.getters.getAllRecipes;
|
||||
},
|
||||
shownRecipes() {
|
||||
if (this.sortedResults.length > 0) {
|
||||
return this.sortedResults;
|
||||
} else {
|
||||
return this.allRecipes;
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
sortAZ() {
|
||||
this.allRecipes.sort((a, b) => (a.name > b.name ? 1 : -1));
|
||||
},
|
||||
sortRecent() {
|
||||
this.allRecipes.sort((a, b) => (a.dateAdded > b.dateAdded ? -1 : 1));
|
||||
assignSorted(val) {
|
||||
this.sortedResults = val;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user