Intro-to-Vue-3
Intro-to-Vue-3 copied to clipboard
L4-end is missing the usage of inventory and onSale data properties.
During lesson 4 an inventory property is added and used on the html to show if the product has stock. The challenge asks to add an onSale boolean property to show an "On Sale!" message. On L4-end branch, both properties are inside the data element but they're not being used inside the html.
The solution on CodePen looks correct.
index.html
in L4-end
branch need to write following codes.
(Quoted solution index.html on CodePen)
~ abbrev. ~
<p v-if="inventory > 10">In Stock</p>
<p v-else-if="inventory <= 10 && inventory > 0">Almost sold out!</p>
<p v-else>Out of Stock</p>
<!-- solution -->
<p v-if="onSale">On Sale!</p>
<!-- solution -->
~ abbrev. ~
P.S. I missed the PR #54