Skip to content

Commit e5992d3

Browse files
committed
Lesson 4
1 parent c37aa9b commit e5992d3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

index.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
<div class="product-display">
1616
<div class="product-container">
1717
<div class="product-image">
18-
<img v-bind:src="image">
18+
<img :src="image">
1919
</div>
2020
<div class="product-info">
2121
<h1>{{ product }}</h1>
22+
<p v-if="inventory > 10">In stock</p>
23+
<p v-else-if="inventory <= 10 && inventory > 0">Almost sold out</p>
24+
<p v-else>Out of stock</p>
25+
<p v-show="onSale">Sale</p>
2226
</div>
2327
</div>
2428
</div>

main.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ const app = Vue.createApp({
22
data() {
33
return {
44
product: 'Socks',
5-
image: './assets/images/socks_blue.jpg'
5+
image: './assets/images/socks_blue.jpg',
6+
inventory: 0,
7+
onSale: false
68
}
79
}
810
})

0 commit comments

Comments
 (0)