import { defineComponent, onMounted, ref, toRef, watch } from 'vue'
import { tools } from '@tools'

export default defineComponent({
  name: 'CPrice',
  props: {
    sale_price: {
      type: Number,
    },
    price: {
      type: Number,
    },
    bold: {
      type: Boolean,
      default: false,
    },
  },

  setup(props) {

    const real_price = ref(0)

    onMounted(() => {

      if (props.sale_price)
        real_price.value = props.sale_price
      else
        real_price.value = props.price ? props.price : 0

    })

    return {
      tools,
      real_price,
    }
  },
})
