mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
feat: added "cookbook" filter to recipe pagination to serve frontend (#1609)
* added cookbook filter to recipe pagination * fixed wrong filter var * restored cookbook sorting * reverted unnecessary var change
This commit is contained in:
parent
d26cb570ba
commit
2007bcfe28
5 changed files with 80 additions and 9 deletions
|
@ -11,25 +11,35 @@
|
|||
</v-card>
|
||||
|
||||
<v-container class="pa-0">
|
||||
<RecipeCardSection class="mb-5 mx-1" :recipes="book.recipes" />
|
||||
<RecipeCardSection
|
||||
class="mb-5 mx-1"
|
||||
:recipes="recipes"
|
||||
:cookbook-slug="slug"
|
||||
@sortRecipes="assignSorted"
|
||||
@replaceRecipes="replaceRecipes"
|
||||
@appendRecipes="appendRecipes"
|
||||
@delete="removeRecipe"
|
||||
/>
|
||||
</v-container>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, useRoute, ref, useMeta } from "@nuxtjs/composition-api";
|
||||
import { useLazyRecipes } from "~/composables/recipes";
|
||||
import RecipeCardSection from "@/components/Domain/Recipe/RecipeCardSection.vue";
|
||||
import { useCookbook } from "~/composables/use-group-cookbooks";
|
||||
|
||||
export default defineComponent({
|
||||
components: { RecipeCardSection },
|
||||
setup() {
|
||||
const { recipes, appendRecipes, assignSorted, removeRecipe, replaceRecipes } = useLazyRecipes();
|
||||
|
||||
const route = useRoute();
|
||||
const slug = route.value.params.slug;
|
||||
const { getOne } = useCookbook();
|
||||
|
||||
const tab = ref(null);
|
||||
|
||||
const book = getOne(slug);
|
||||
|
||||
useMeta(() => {
|
||||
|
@ -40,7 +50,13 @@ export default defineComponent({
|
|||
|
||||
return {
|
||||
book,
|
||||
slug,
|
||||
tab,
|
||||
appendRecipes,
|
||||
assignSorted,
|
||||
recipes,
|
||||
removeRecipe,
|
||||
replaceRecipes,
|
||||
};
|
||||
},
|
||||
head: {}, // Must include for useMeta
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue