v2 search basic display of recipes
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -16,9 +16,10 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-md-12">
|
<div class="col col-md-12">
|
||||||
<ul>
|
<b-card-group deck>
|
||||||
<li v-for="r in recipes" v-bind:key="r.id">{{ r.name }}</li>
|
<recipe-card style="max-width: 15vw; height: 30vh" v-for="r in recipes" v-bind:key="r.id" :recipe="r"></recipe-card>
|
||||||
</ul>
|
</b-card-group>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -45,13 +46,14 @@ import {ResolveUrlMixin} from "@/utils/utils";
|
|||||||
import LoadingSpinner from "@/components/LoadingSpinner";
|
import LoadingSpinner from "@/components/LoadingSpinner";
|
||||||
|
|
||||||
import {ApiApiFactory} from "@/utils/openapi/api.ts";
|
import {ApiApiFactory} from "@/utils/openapi/api.ts";
|
||||||
|
import RecipeCard from "@/components/RecipeCard";
|
||||||
|
|
||||||
Vue.use(BootstrapVue)
|
Vue.use(BootstrapVue)
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RecipeSearchView',
|
name: 'RecipeSearchView',
|
||||||
mixins: [],
|
mixins: [],
|
||||||
components: {},
|
components: {RecipeCard},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
recipes: [],
|
recipes: [],
|
||||||
|
34
vue/src/components/RecipeCard.vue
Normal file
34
vue/src/components/RecipeCard.vue
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<b-card no-body>
|
||||||
|
|
||||||
|
<b-card-img-lazy :src=recipe.image v-bind:alt="$t('Recipe_Image')" top></b-card-img-lazy>
|
||||||
|
|
||||||
|
<b-card-body :title=recipe.name>
|
||||||
|
<recipe-context-menu :recipe="recipe"></recipe-context-menu>
|
||||||
|
<b-card-text>
|
||||||
|
{{ recipe.description }}
|
||||||
|
</b-card-text>
|
||||||
|
</b-card-body>
|
||||||
|
|
||||||
|
</b-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import RecipeContextMenu from "@/components/RecipeContextMenu";
|
||||||
|
export default {
|
||||||
|
name: "RecipeCard",
|
||||||
|
components: {RecipeContextMenu},
|
||||||
|
props: {
|
||||||
|
recipe: Object,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Reference in New Issue
Block a user