summaryrefslogtreecommitdiff
path: root/iridescence/src/components/InventoryCard.vue
diff options
context:
space:
mode:
authorAdam Carpenter <atc@53hor.net>2020-04-30 21:31:30 -0400
committerAdam Carpenter <atc@53hor.net>2020-04-30 21:31:30 -0400
commitc499946400c775f311d52236d9d1fef3f19a68ff (patch)
treeccff75f9679f3c23e4e9c7c3c04855e6be846adf /iridescence/src/components/InventoryCard.vue
parent9119c86ff94fd29086dfd342a616993f20fc5c75 (diff)
downloadtheglassyladies-c499946400c775f311d52236d9d1fef3f19a68ff.tar.xz
theglassyladies-c499946400c775f311d52236d9d1fef3f19a68ff.zip
moved search into InventorySearch and started work on filters; updated quantity display
Diffstat (limited to 'iridescence/src/components/InventoryCard.vue')
-rw-r--r--iridescence/src/components/InventoryCard.vue13
1 files changed, 12 insertions, 1 deletions
diff --git a/iridescence/src/components/InventoryCard.vue b/iridescence/src/components/InventoryCard.vue
index 75e683a..6bcc548 100644
--- a/iridescence/src/components/InventoryCard.vue
+++ b/iridescence/src/components/InventoryCard.vue
@@ -15,7 +15,7 @@
<p class="subtitle is-4">
{{ dollars(cents) }}
</p>
- <p class="subtitle is-6">{{ quantity }} in stock.</p>
+ <p class="subtitle is-6">{{ stock }}</p>
</div>
<div class="content">
@@ -37,6 +37,17 @@ export default {
imgPath: String,
description: String
},
+ computed: {
+ stock() {
+ if (this.quantity < 0) {
+ return "Made to order";
+ } else if (this.quantity == 0) {
+ return "Out of stock";
+ } else {
+ return [this.quantity, "in stock"].join(" ");
+ }
+ }
+ },
methods: {
dollars: cents => "$ " + (cents / 100).toFixed(2)
}