'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var index = require('../../image/index.js');
var constants = require('../../../utils/constants.js');
var radio = require('./radio.js');

var script = vue.defineComponent({
  name: "ElRadioItem",
  components: {
    ElImage: index.ElImage
  },
  props: {
    modelValue: {
      type: [String, Number, Boolean],
      default: ""
    },
    label: {
      type: [String, Number, Boolean],
      default: ""
    },
    name: {
      type: String,
      default: ""
    },
    iconUrl: {
      type: String,
      default: ""
    }
  },
  setup(props, { emit }) {
    const { isGroup, radioGroup, focus, disabled: disabled2 } = radio.useRadio(props, emit);
    const radioRef = vue.ref();
    const value = vue.computed({
      get() {
        return isGroup.value ? radioGroup.modelValue : props.modelValue;
      },
      set(value2) {
        if (isGroup.value) {
          radioGroup.changeEvent(value2);
          radioRef.value.checked = radioGroup.modelValue === props.label;
        } else {
          emit(constants.UPDATE_MODEL_EVENT, value2);
        }
      }
    });
    return {
      isDisabled: disabled2,
      focus,
      value,
      radioRef
    };
  }
});

exports["default"] = script;
//# sourceMappingURL=radio-item.vue_vue_type_script_lang.js.map
