<template>
  <div class="options">
    <el-option
      v-for="(option, i) in options"
      :key="getKey(option, i)"
      :label="getLabel(option, i)"
      :value="getValue(option, i)"
      :disabled="option.disabled"
    ></el-option>
  </div>
</template>

<script>
export default {
  name: 'SimpleOptions',
  props: {
    options: Array,
    label: String,
    value: String,
  },
  methods: {
    getKey(option, i) {
      return 'option_' + i
    },
    getLabel(option) {
      return this.label ? option[this.label] : option.label
    },
    getValue(option) {
      return this.value ? option[this.value] : option.value
    },
  },
}
</script>
