<template>
  <div class="row form-group" :key="$attrs.key">
    <div
      v-for="(option, index) in localFormElement.options"
      class="custom-control custom-radio custom-control-inline"
      :key="index"
    >
      <input
        class="custom-control-input"
        :class="[$attrs.labelClass ?? '', { error: hasError }]"
        :type="localFormElement.type"
        :id="option.value"
        :name="option.value"
        v-model="localFormElement.value"
        :value="option.value"
        @focus="clearErrors"
        @blur="validate"
        @keydown.enter="$emit('keydown', $event)"
      />
      <label class="custom-control-label" :for="option.value">{{
        option.label
      }}:</label>
    </div>
    
  </div>
</template>

<script>
import formBuilderMixin from "@mixins/formBuilderMixin";
export default {
  mixins: [formBuilderMixin],
};
</script>
