<template>
  <b-field class="column mb-0 pb-0" label="Carrito" :class="columnSize">
    <b-input
      icon="cart"
      maxlength="3"
      placeholder="Carrito"
      type="text"
      :has-counter="false"
      @keyup.enter.native="ejecutar()"
      v-model="carrito"
      rounded
    />
  </b-field>
</template>

<script>
export default {
  props: {
    ejecutar: { typeof: Function, required: true, default: () => {} },
    carritoPadre: { typeof: String, required: true, default: '' },
    columnSize: { typeof: String, required: false, default: '' },
  },
  data: () => {
    return { carrito: '' }
  },
  watch: {
    carrito() {
      this.$emit('carrito', this.carrito)
    },
    carritoPadre() {
      this.carrito = this.carritoPadre
    },
  },
}
</script>

<style scoped></style>
