<template>
  <b-field
    :class="column ? `column ${columnSize} mb-0 pb-0` : ''"
    :label="label || 'Correo'"
  >
    <b-input
      icon="email"
      placeholder="Correo"
      type="email"
      :disabled="disabled"
      @keyup.enter.native="ejecutar()"
      v-model="correo"
      rounded
    />
  </b-field>
</template>

<script>
export default {
  props: {
    column: { type: Boolean, required: false, default: false },
    disabled: { type: Boolean, required: false, default: false },
    ejecutar: {
      typeof: Function,
      required: false,
      default: () => function () {},
    },
    correoPadre: { typeof: String, required: true, default: '' },
    columnSize: { typeof: String, required: false, default: '' },
    label: { typeof: String, required: false, default: '' },
  },
  data: () => {
    return { correo: '' }
  },
  watch: {
    correo() {
      this.$emit('correo', this.correo)
    },
    correoPadre() {
      this.correo = this.correoPadre
    },
  },
}
</script>

<style scoped></style>
