Untitled

 avatar
unknown
plain_text
a year ago
1.0 kB
2
Indexable
<template>
  <fragment>
    <tr>
      <td>
        <p v-if="title">
          {{ title
          }}<span
            ><sup v-for="id in price.footnotes" :key="id"> {{ id }})</sup></span
          >
        </p>
      </td>
      <td class="text--right">
        <p v-if="price">
          <fragment v-if="isDecimal">
            {{ price[clientPriceType] | formatPrice }}
          </fragment>
          <fragment v-else>
            {{ Math.ceil(price[clientPriceType]) }}
          </fragment>
          {{ price.currency }}
        </p>
      </td>
    </tr>
  </fragment>
</template>

<script>
import formatPrice from '../filters/formatPrice';

export default {
  props: {
    price: {
      type: Object,
      default: () => ({ value: 0, currency: '', footnotes: [] })
    },
    title: {
      type: String,
      default: ''
    },
    isDecimal: {
      type: Boolean,
      default: false
    },
    clientPriceType: {
      type: String,
      default: 'brutto'
    }
  },
  filters: {
    formatPrice
  }
};
</script>