<template>
  <el-radio-group
    v-model="selectValue"
    :filterable="filterable"
    :clearable="clearable"
    :placeholder="placeholder"
    :disabled="disabled"
    style="width: 100%"
    @change="change"
  >
    <el-radio-button
      v-for="option in options"
      :key="option.id"
      :label="option.id"
    >{{ option.name }}</el-radio-button>
  </el-radio-group>
</template>

<script>
export default {
  name: 'MyRadioButtonGroup',
  props: {
    value: {
      required: true
    },
    options: {
      required: true,
      type: Array
    },
    filterable: {
      type: Boolean
    },
    clearable: {
      type: Boolean
    },
    placeholder: {},
    disabled: {
      type: Boolean
    }
  },
  computed: {
    selectValue: {
      set (value) {
        this.$emit('input', value)
      },
      get () {
        return this.value
      }
    }
  },
  methods: {
    change (...args) {
      this.$emit('change', ...args)
    }
  }
}
</script>

<style lang="scss"></style>
