@@ -25,7 +25,7 @@
<h2>Available?</h2>
<p v-cloak v-show="inStock">In stock</p>
<p v-cloak v-show="!inStock">Out of stock</p>
- <p v-if="onSale">On sale! Act fast.</p>
+ <p v-cloak v-if="onSale">{{ flashSale }}</p>
<h2>Details</h2>
<ul>
@@ -12,6 +12,11 @@ const app = new Vue({
inStock() {
return this.variants[this.selectedVariant].variantQuantity > 0;
},
+ flashSale() {
+ if (this.onSale) {
+ return `Vente flash ${this.product} ${this.brand}. Plus que 10 minutes!`;
+ }
+ },
title() {
return [this.brand, this.product].join(' ');
}