mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-01 02:58:07 -04:00
* automated docs update * recipe rating component * recipe partial updates - closes #25 * use Vue.delete to update store * format * arrow functions * fix tests * format * initial context menu * localize * add confirmation dialog * context menu * fix bare exception * update line length * format all file with prettier * update changelog * download as json * update python dependencies * update javascript dependencies Co-authored-by: hay-kot <hay-kot@pm.me>
50 lines
996 B
Vue
50 lines
996 B
Vue
<template>
|
|
<v-container>
|
|
<v-progress-linear v-if="loading" indeterminate color="primary"></v-progress-linear>
|
|
<CardSection
|
|
:sortable="true"
|
|
:title="$t('page.all-recipes')"
|
|
:recipes="allRecipes"
|
|
@sort="sortAZ"
|
|
@sort-recent="sortRecent"
|
|
/>
|
|
</v-container>
|
|
</template>
|
|
|
|
<script>
|
|
import CardSection from "@/components/UI/CardSection";
|
|
|
|
export default {
|
|
components: {
|
|
CardSection,
|
|
},
|
|
data() {
|
|
return {
|
|
loading: false,
|
|
};
|
|
},
|
|
async mounted() {
|
|
if (this.allRecipes.length < 1) {
|
|
this.loading = true;
|
|
}
|
|
await this.$store.dispatch("requestAllRecipes");
|
|
this.loading = false;
|
|
},
|
|
computed: {
|
|
allRecipes() {
|
|
return this.$store.getters.getAllRecipes;
|
|
},
|
|
},
|
|
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));
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style></style>
|