RecipeModal.vue 918 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4" @click.self="$emit('close')">
  3. <div class="bg-white rounded-lg border-2 border-black max-w-4xl max-h-[90vh] overflow-y-auto">
  4. <div class="sticky top-0 bg-white border-b-2 border-black p-4 flex items-center justify-between">
  5. <h3 class="text-lg font-bold">菜谱详情</h3>
  6. <button @click="$emit('close')" class="text-gray-500 hover:text-gray-700 text-xl">✕</button>
  7. </div>
  8. <div class="p-4">
  9. <RecipeCard :recipe="recipe" :showFavoriteButton="false" />
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script setup lang="ts">
  15. import type { Recipe } from '@/types'
  16. import RecipeCard from './RecipeCard.vue'
  17. interface Props {
  18. recipe: Recipe
  19. }
  20. defineProps<Props>()
  21. defineEmits<{
  22. close: []
  23. }>()
  24. </script>