summaryrefslogblamecommitdiff
path: root/iridescence/src/components/InventoryCard.vue
blob: 75e683a3e685f741dd698b7aa65a677cefa3f1e4 (plain) (tree)











































                                                                   
<template>
  <div id="inventoryCard">
    <div class="card">
      <div class="card-image">
        <figure class="image is-4by3">
          <img
            src="https://bulma.io/images/placeholders/1280x960.png"
            :alt="name"
          />
        </figure>
      </div>
      <div class="card-content">
        <div class="content">
          <p class="title is-4">{{ name }}</p>
          <p class="subtitle is-4">
            {{ dollars(cents) }}
          </p>
          <p class="subtitle is-6">{{ quantity }} in stock.</p>
        </div>

        <div class="content">
          {{ description }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "InventoryCard",
  props: {
    id: Number,
    name: String,
    quantity: Number,
    cents: Number,
    imgPath: String,
    description: String
  },
  methods: {
    dollars: cents => "$ " + (cents / 100).toFixed(2)
  }
};
</script>