<template>
  <label class="e-radio__item" :class="[{'e-radio__item--disabled':disabled}]">
    <span class="e-radio__item--box">
      <input type="radio" name="radio" :disabled="disabled" :checked="checked" @change="onChange" />
      <i></i>
    </span>
    <span class="e-radio__item--text"><slot></slot></span>
  </label>
</template>
<script>
export default{
  name:'emmm-radio-item',
  data(){
    return {
      checked: false
    }
  },
  props:{
    value: [String, Number],
    disabled: Boolean
  },
  methods: {
    onChange (event) {
      if (this.disabled) return
      this.checked = event.target.checked
      this.$parent.change(this.value)
    }
  }
}

</script>
<style>
</style>
