46 lines
No EOL
787 B
Vue
46 lines
No EOL
787 B
Vue
<template>
|
|
<div class="recipe-card">
|
|
<p>
|
|
<img v-if="recipe.image_urls" :src="recipe.image_urls[0]" />
|
|
<img v-else src="@/assets/egg.svg" />
|
|
</p>
|
|
<p class="recipe-name">{{ recipe.name }}</p>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'RecipeCard',
|
|
props: ['recipe']
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
.recipe-card {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
border: solid 1px #ccc;
|
|
border-radius: 3px;
|
|
padding: 1vh;
|
|
text-align: left;
|
|
max-height: 10em;
|
|
}
|
|
|
|
li img {
|
|
display: block;
|
|
width: 3em;
|
|
height: 3em;
|
|
margin: 3px;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.recipe-name {
|
|
font-size: larger;
|
|
font-weight: bold;
|
|
flex: 1;
|
|
margin: auto;
|
|
}
|
|
|
|
</style> |