We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c37aa9b commit e5992d3Copy full SHA for e5992d3
index.html
@@ -15,10 +15,14 @@
15
<div class="product-display">
16
<div class="product-container">
17
<div class="product-image">
18
- <img v-bind:src="image">
+ <img :src="image">
19
</div>
20
<div class="product-info">
21
<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>
26
27
28
main.js
@@ -2,7 +2,9 @@ const app = Vue.createApp({
2
data() {
3
return {
4
product: 'Socks',
5
- image: './assets/images/socks_blue.jpg'
+ image: './assets/images/socks_blue.jpg',
6
+ inventory: 0,
7
+ onSale: false
8
}
9
10
})
0 commit comments