Skip to content

Commit 53fe4d8

Browse files
committed
Add example code for lesson 2.3
1 parent 0c5ec5e commit 53fe4d8

File tree

1 file changed

+10
-6
lines changed
  • 02-designing-an-image-card/01-structuring-a-basic-card/src/components

1 file changed

+10
-6
lines changed

02-designing-an-image-card/01-structuring-a-basic-card/src/components/PropertyCard.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
<div class="bg-white border rounded-lg overflow-hidden">
33
<img :src="property.imageUrl" :alt="property.imageAlt">
44
<div class="p-6">
5-
<h4>{{ property.title }}</h4>
6-
<div>
5+
<div class="text-gray-600 text-xs uppercase font-semibold tracking-wide">
76
{{ property.beds }} beds &bull; {{ property.baths }} baths
87
</div>
9-
<div>
10-
{{ property.formattedPrice }} / wk
8+
<h4 class="font-semibold text-lg leading-tight truncate">{{ property.title }}</h4>
9+
<div class="mt-1">
10+
{{ property.formattedPrice }}
11+
<span class="text-gray-600 text-sm"> / wk</span>
1112
</div>
12-
<div>
13-
{{ property.rating }}/5 stars (based on {{ property.reviewCount }} reviews)
13+
<div class="mt-2 flex items-center">
14+
<svg v-for="i in 5" :key="i" :class="i <= property.rating ? 'text-teal-500' : 'text-gray-400'" class="h-4 w-4 fill-current" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
15+
<path d="M8.133 20.333c-1.147.628-2.488-.387-2.269-1.718l.739-4.488-3.13-3.178c-.927-.943-.415-2.585.867-2.78l4.324-.654 1.934-4.083a1.536 1.536 0 0 1 2.804 0l1.934 4.083 4.324.655c1.282.194 1.794 1.836.866 2.78l-3.129 3.177.739 4.488c.219 1.331-1.122 2.346-2.269 1.718L12 18.214l-3.867 2.119z" fill-rule="evenodd"/>
16+
</svg>
17+
<span class="ml-2 text-gray-600 text-sm">{{ property.reviewCount }} reviews</span>
1418
</div>
1519
</div>
1620
</div>

0 commit comments

Comments
 (0)