<template>
  <div>
    <el-radio-group @mouseenter="handleMouseEnter"
                    @mouseleave="handleMouseLeave"
                    @dblclick="handleDblClick(text)"
                    @click="handleClick(text)"
                    @change="handleChange(text)"
                    v-model="text"
                    :disabled="option.disabled">
      <template v-if="option.button">
        <el-radio-button v-for="item in dataChart"
                         :key="item.value"
                         :value="item.value"
                         :disabled="item.disabled">
          {{ item.label }}
        </el-radio-button>
      </template>
      <template v-else>
        <el-radio v-for="item in dataChart"
                  :key="item.value"
                  :value="item.value"
                  :disabled="item.disabled">
          {{ item.label }}
        </el-radio>
      </template>
    </el-radio-group>
  </div>
</template>

<script>
export default {
  name: 'radio',
  props: {
    option: {
      type: Object
    }
  },
  data () {
    return {
      text: ''
    }
  }
}
</script> 